[Catalyst-commits] r12611 - HTTP-Request-AsCGI/trunk/lib/HTTP/Request

miyagawa at dev.catalyst.perl.org miyagawa at dev.catalyst.perl.org
Mon Jan 11 22:59:18 GMT 2010


Author: miyagawa
Date: 2010-01-11 22:59:17 +0000 (Mon, 11 Jan 2010)
New Revision: 12611

Modified:
   HTTP-Request-AsCGI/trunk/lib/HTTP/Request/AsCGI.pm
Log:
Retrieve REQUEST_URI before calling ->canonical since that decodes URI
safe characters, so we can properly test those REQUEST_URI
undecoded-ness. Required for Catalyst and Plack to retrieve as raw
value as possible.


Modified: HTTP-Request-AsCGI/trunk/lib/HTTP/Request/AsCGI.pm
===================================================================
--- HTTP-Request-AsCGI/trunk/lib/HTTP/Request/AsCGI.pm	2010-01-11 22:56:23 UTC (rev 12610)
+++ HTTP-Request-AsCGI/trunk/lib/HTTP/Request/AsCGI.pm	2010-01-11 22:59:17 UTC (rev 12611)
@@ -54,6 +54,9 @@
     $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 @@
         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,
         @_
     };




More information about the Catalyst-commits mailing list