Skip to content

Commit

Permalink
Use do block instead of unnamed block in adapt_psgi
Browse files Browse the repository at this point in the history
  • Loading branch information
bbrtj committed Oct 10, 2024
1 parent eeb6429 commit 758e7ea
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/Kelp/Util.pm
Original file line number Diff line number Diff line change
Expand Up @@ -138,16 +138,16 @@ sub adapt_psgi
$path =~ s{^/?}{/};
$path =~ s{/?$}{$trailing_slash};

my $result;
{
my $result = do {

# adjust script and path
local $env->{SCRIPT_NAME} = $orig_path;
$env->{SCRIPT_NAME} =~ s{\Q$path\E$}{};
local $env->{PATH_INFO} = $path;

# run the callback
$result = $app->($env);
}
$app->($env);
};

# produce a response
if (ref $result eq 'ARRAY') {
Expand Down

0 comments on commit 758e7ea

Please sign in to comment.