[Catalyst-commits] r9879 - in HTTP-Request-AsCGI/trunk: .
lib/HTTP/Request t
hdp at dev.catalyst.perl.org
hdp at dev.catalyst.perl.org
Mon Apr 27 03:46:58 GMT 2009
Author: hdp
Date: 2009-04-27 04:46:58 +0100 (Mon, 27 Apr 2009)
New Revision: 9879
Modified:
HTTP-Request-AsCGI/trunk/Changes
HTTP-Request-AsCGI/trunk/dist.ini
HTTP-Request-AsCGI/trunk/lib/HTTP/Request/AsCGI.pm
HTTP-Request-AsCGI/trunk/t/05env.t
Log:
uri_unescape PATH_INFO
Modified: HTTP-Request-AsCGI/trunk/Changes
===================================================================
--- HTTP-Request-AsCGI/trunk/Changes 2009-04-27 03:10:11 UTC (rev 9878)
+++ HTTP-Request-AsCGI/trunk/Changes 2009-04-27 03:46:58 UTC (rev 9879)
@@ -1,13 +1,16 @@
This file documents the revision history for Perl extension HTTP::Request::AsCGI.
-0.6 2009-04-29
+0.7 2009-04-26
+ - PATH_INFO is now uri_unescaped
+
+0.6 2009-04-26
- Fix long-standing 'enviroment' typo
- Switch to Dist::Zilla
-0.5_03 2009-04-29
+0.5_03 2009-04-26
- RT#18075: Play more nicely with Perl 5.6's open(). (hdp)
-0.5_02 2009-04-29
+0.5_02 2009-04-26
- Avoid mixing buffered and unbuffered IO and flush STDIN after writing
request content to it. (hdp)
Modified: HTTP-Request-AsCGI/trunk/dist.ini
===================================================================
--- HTTP-Request-AsCGI/trunk/dist.ini 2009-04-27 03:10:11 UTC (rev 9878)
+++ HTTP-Request-AsCGI/trunk/dist.ini 2009-04-27 03:46:58 UTC (rev 9879)
@@ -12,6 +12,7 @@
HTTP::Response = 1.53
IO::File = 0
Test::More = 0
+URI::Escape = 0
[@Classic]
Modified: HTTP-Request-AsCGI/trunk/lib/HTTP/Request/AsCGI.pm
===================================================================
--- HTTP-Request-AsCGI/trunk/lib/HTTP/Request/AsCGI.pm 2009-04-27 03:10:11 UTC (rev 9878)
+++ HTTP-Request-AsCGI/trunk/lib/HTTP/Request/AsCGI.pm 2009-04-27 03:46:58 UTC (rev 9879)
@@ -9,6 +9,7 @@
use HTTP::Response;
use IO::Handle;
use IO::File;
+use URI::Escape ();
__PACKAGE__->mk_accessors(qw[ environment request stdin stdout stderr ]);
@@ -49,7 +50,7 @@
GATEWAY_INTERFACE => 'CGI/1.1',
HTTP_HOST => $uri->host_port,
HTTPS => ( $uri->scheme eq 'https' ) ? 'ON' : 'OFF', # not in RFC 3875
- PATH_INFO => $uri->path,
+ PATH_INFO => URI::Escape::uri_unescape($uri->path),
QUERY_STRING => $uri->query || '',
SCRIPT_NAME => '/',
SERVER_NAME => $uri->host,
Modified: HTTP-Request-AsCGI/trunk/t/05env.t
===================================================================
--- HTTP-Request-AsCGI/trunk/t/05env.t 2009-04-27 03:10:11 UTC (rev 9878)
+++ HTTP-Request-AsCGI/trunk/t/05env.t 2009-04-27 03:46:58 UTC (rev 9879)
@@ -8,7 +8,7 @@
use HTTP::Request;
use HTTP::Request::AsCGI;
-my $r = HTTP::Request->new( GET => 'http://www.host.com/cgi-bin/script.cgi/my/path/?a=1&b=2', [ 'X-Test' => 'Test' ] );
+my $r = HTTP::Request->new( GET => 'http://www.host.com/cgi-bin/script.cgi/my%20path/?a=1&b=2', [ 'X-Test' => 'Test' ] );
my %e = ( SCRIPT_NAME => '/cgi-bin/script.cgi' );
my $c = HTTP::Request::AsCGI->new( $r, %e );
$c->stdout(undef);
@@ -18,7 +18,7 @@
is( $ENV{GATEWAY_INTERFACE}, 'CGI/1.1', 'GATEWAY_INTERFACE' );
is( $ENV{HTTP_HOST}, 'www.host.com:80', 'HTTP_HOST' );
is( $ENV{HTTP_X_TEST}, 'Test', 'HTTP_X_TEST' );
-is( $ENV{PATH_INFO}, '/my/path/', 'PATH_INFO' );
+is( $ENV{PATH_INFO}, '/my path/', 'PATH_INFO' );
is( $ENV{QUERY_STRING}, 'a=1&b=2', 'QUERY_STRING' );
is( $ENV{SCRIPT_NAME}, '/cgi-bin/script.cgi', 'SCRIPT_NAME' );
is( $ENV{REQUEST_METHOD}, 'GET', 'REQUEST_METHOD' );
More information about the Catalyst-commits
mailing list