Canonicalize the url becuse we're building it from the always-undecoded REQUEST_URI...
Florian Ragwitz [Mon, 11 Jan 2010 22:23:56 +0000 (22:23 +0000)]
lib/Catalyst/Engine.pm
t/aggregate/live_engine_request_escaped_path.t

index ca836f9..c8e9c7c 100644 (file)
@@ -537,7 +537,7 @@ sub prepare_path {
     my $query = $env->{QUERY_STRING} ? '?' . $env->{QUERY_STRING} : '';
     my $uri   = $scheme . '://' . $host . '/' . $path . $query;
 
-    $ctx->request->uri( bless \$uri, $uri_class );
+    $ctx->request->uri( (bless \$uri, $uri_class)->canonical );
 
     # set the base URI
     # base must end in a slash
index 92bd2ee..e86c154 100644 (file)
@@ -18,11 +18,7 @@ use Catalyst::Test 'TestApp';
 
 # test that request with URL-escaped code works.
 {
-    my $response = request('http://localhost/args/param%73/one/two', {
-        extra_env => { PATH_INFO => '/args/param%73/one/two' },
-    });
-
-    ok( $response );
+    ok( my $response = request('http://localhost/args/param%73/one/two') );
     ok( $response->is_success, 'Response Successful 2xx' );
     is( $response->content, 'onetwo' );
 }