X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FHTTP%2FRequest%2FAsCGI.pm;fp=lib%2FHTTP%2FRequest%2FAsCGI.pm;h=274dda9b1d3442ade2b577ced8fdd8d6cfabe123;hb=b3996e05bfe1215120fa89374d981709bf45c6bb;hp=099ce1d7cfecf24df69b6a3fb62e697920487bd8;hpb=903274b10a16afd05e83800ea7fc0a1cd9c993b9;p=catagits%2FHTTP-Request-AsCGI.git diff --git a/lib/HTTP/Request/AsCGI.pm b/lib/HTTP/Request/AsCGI.pm index 099ce1d..274dda9 100644 --- a/lib/HTTP/Request/AsCGI.pm +++ b/lib/HTTP/Request/AsCGI.pm @@ -54,6 +54,9 @@ sub new { $uri->port(80) unless $uri->port; $uri->host_port($host) unless !$host || ( $host eq $uri->host_port ); + # Get it before canonicalized so REQUEST_URI can be as raw as possible + my $request_uri = $uri->path_query; + $uri = $uri->canonical; my $environment = { @@ -70,7 +73,7 @@ sub new { REMOTE_ADDR => '127.0.0.1', REMOTE_HOST => 'localhost', REMOTE_PORT => int( rand(64000) + 1000 ), # not in RFC 3875 - REQUEST_URI => $uri->path_query, # not in RFC 3875 + REQUEST_URI => $request_uri, # not in RFC 3875 REQUEST_METHOD => $request->method, @_ };