Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix PATH_INFO from REQUEST_URI for FCGI.

  • Loading branch information...
commit 2c7c44d55b050633faa38bb3beac2b5e10f84563 1 parent 4f68dc4
@KnowZero authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/Plack/Middleware/IIS6ScriptNameFix.pm
View
6 lib/Plack/Middleware/IIS6ScriptNameFix.pm
@@ -7,7 +7,11 @@ sub call {
my($self, $env) = @_;
if ($env->{SERVER_SOFTWARE} && $env->{SERVER_SOFTWARE} =~ /IIS\/[6-9]\.[0-9]/) {
- my @script_name = split(m!/!, $env->{PATH_INFO});
+
+ my ($path) = ( $env->{REQUEST_URI} =~ /^([^?]*)(?:\?.*)?$/s );
+ $path =~ s/#.*$// if defined && length; # dumb clients sending URI fragments
+
+ my @script_name = split(m!/!, URI::Escape::uri_unescape($path));
my @path_translated = split(m!/|\\\\?!, $env->{PATH_TRANSLATED});
my @path_info;
Please sign in to comment.
Something went wrong with that request. Please try again.