From: Florian Ragwitz Date: Mon, 11 Jan 2010 22:23:56 +0000 (+0000) Subject: Canonicalize the url becuse we're building it from the always-undecoded REQUEST_URI... X-Git-Tag: 5.89000~47 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=4ee03d727423d0eab446e173ceb882163bc58f48;hp=16918b4dbfe57d453aaf5e6d80ca92290722733a Canonicalize the url becuse we're building it from the always-undecoded REQUEST_URI, not PATH_INFO. --- diff --git a/lib/Catalyst/Engine.pm b/lib/Catalyst/Engine.pm index ca836f9..c8e9c7c 100644 --- a/lib/Catalyst/Engine.pm +++ b/lib/Catalyst/Engine.pm @@ -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 diff --git a/t/aggregate/live_engine_request_escaped_path.t b/t/aggregate/live_engine_request_escaped_path.t index 92bd2ee..e86c154 100644 --- a/t/aggregate/live_engine_request_escaped_path.t +++ b/t/aggregate/live_engine_request_escaped_path.t @@ -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' ); }