Thank you to anyone who has already donated - your generous donations helped make three months of treatment possible.
My brother Nate continues to fight stage IV Hodgkin's lymphoma. He's just 31, with a wife and baby girl. They have no active income (since he's been unable to return to work), no insurance, and cannot afford the treatment he needs. Nate and his family need your help. Please consider a donation, every dollar helps. Thanks.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
diff --git a/lib/Catalyst/Engine/CGI.pm b/lib/Catalyst/Engine/CGI.pm index 8416e09..8c77ca1 100644 --- a/lib/Catalyst/Engine/CGI.pm +++ b/lib/Catalyst/Engine/CGI.pm @@ -142,8 +142,20 @@ sub prepare_path { } } + # RFC 3875: "Unlike a URI path, the PATH_INFO is not URL-encoded, + # and cannot contain path-segment parameters." This means PATH_INFO + # is always decoded, and the script can't determine / vs %2F. + # See https://issues.apache.org/bugzilla/show_bug.cgi?id=35256 + # Here we try to resurrect the original encoding from REQUEST_URI. + my $path_info = $ENV{PATH_INFO}; + if (my $req_uri = $ENV{REQUEST_URI}) { + $req_uri =~ s/^\Q$ENV{SCRIPT_NAME}\E//; + $req_uri =~ s/\?.*$//; + $path_info = $req_uri if $req_uri; + } + # set the request URI - my $path = $base_path . ( $ENV{PATH_INFO} || '' ); + my $path = $base_path . ( $path_info || '' ); $path =~ s{^/+}{}; # Using URI directly is way too slow, so we construct the URLs manually diff --git a/t/aggregate/live_component_controller_action_chained.t b/t/aggregate/live_component_controller_action_chained.t old mode 100644 new mode 100755 diff --git a/t/aggregate/live_engine_request_escaped_path.t b/t/aggregate/live_engine_request_escaped_path.t old mode 100644 new mode 100755 |