Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fix PATH_INFO from REQUEST_URI from FCGI. #303

Open
wants to merge 1 commit into from

1 participant

@KnowZero

Fixed to only commit to IIS6 middleware

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jun 29, 2012
  1. @KnowZero
This page is out of date. Refresh to see the latest.
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;
Something went wrong with that request. Please try again.