Skip to content

Commit

Permalink
fix undef PATH_INFO RT:60472
Browse files Browse the repository at this point in the history
  • Loading branch information
miyagawa committed Aug 29, 2010
1 parent 85f5f19 commit 5729dc2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/Plack/Handler/Apache2.pm
Expand Up @@ -48,7 +48,7 @@ sub call_app {
'psgi.nonblocking' => Plack::Util::FALSE,
};

$class->_recalc_paths($r, $env);
$class->fixup_path($r, $env);

my $res = $app->($env);

Expand All @@ -75,9 +75,9 @@ sub handler {
}

# The method for PH::Apache2::Regitsry to override.
sub _recalc_paths {
sub fixup_path {
my ($class, $r, $env) = @_;
my $vpath = $env->{SCRIPT_NAME} . $env->{PATH_INFO};
my $vpath = $env->{SCRIPT_NAME} . ($env->{PATH_INFO} || '');
my $location = $r->location || "/";
$location =~ s{/$}{};
(my $path_info = $vpath) =~ s/^\Q$location\E//;
Expand Down
2 changes: 1 addition & 1 deletion lib/Plack/Handler/Apache2/Registry.pm
Expand Up @@ -25,7 +25,7 @@ sub handler {
}

# Overriding
sub _recalc_paths {}
sub fixup_path {}

1;

Expand Down

0 comments on commit 5729dc2

Please sign in to comment.