Permalink
Browse files

Do not repeat SCRIPT_NAME in the resurrected PATH_INFO from REQUEST_U…

…RI. Fixes gh-161
  • Loading branch information...
1 parent 5d5fff3 commit 2af4bb5b149d5bd2d819feb49e6f1482db85dbd4 @miyagawa miyagawa committed Dec 25, 2010
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/Plack/Handler/FCGI.pm
@@ -104,9 +104,10 @@ sub run {
delete $env->{HTTP_CONTENT_TYPE};
delete $env->{HTTP_CONTENT_LENGTH};
- # recover multiple slashes
+ # lighttpd munges multiple slashes in PATH_INFO into one. Try recovering it
my $uri = URI->new($env->{REQUEST_URI});
$env->{PATH_INFO} = uri_unescape($uri->path);
+ $env->{PATH_INFO} =~ s/^\Q$env->{SCRIPT_NAME}\E//;
if ($env->{SERVER_SOFTWARE} && $env->{SERVER_SOFTWARE} =~ m!lighttpd[-/]1\.(\d+\.\d+)!) {
no warnings;

0 comments on commit 2af4bb5

Please sign in to comment.