From: Tomas Doran Date: Mon, 11 Jan 2010 23:18:08 +0000 (+0000) Subject: Fix URI bug masked by HTTP::Request::AsCGI X-Git-Tag: 5.80018~3 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=ca78941c9da0a5d9ff5a400f5a8e5ef7f9308cd8 Fix URI bug masked by HTTP::Request::AsCGI --- diff --git a/Changes b/Changes index 176d54d..7f5aff0 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,10 @@ # This file documents the revision history for Perl extension Catalyst. + Bug fixed: + - Call ->canonical on URI derived from $ENV{REQUEST_URI} to get + paths correctly decoded. This bug was previously hidden by a bug + in HTTP::Request::AsCGI + Documentation: - Clarify that uri_for_action works on private paths, with example. diff --git a/lib/Catalyst/Engine/CGI.pm b/lib/Catalyst/Engine/CGI.pm index 413ce11..c57c8a5 100644 --- a/lib/Catalyst/Engine/CGI.pm +++ b/lib/Catalyst/Engine/CGI.pm @@ -195,7 +195,7 @@ sub prepare_path { my $query = $ENV{QUERY_STRING} ? '?' . $ENV{QUERY_STRING} : ''; my $uri = $scheme . '://' . $host . '/' . $path . $query; - $c->request->uri( bless \$uri, $uri_class ); + $c->request->uri( bless(\$uri, $uri_class)->canonical ); # set the base URI # base must end in a slash @@ -203,7 +203,7 @@ sub prepare_path { my $base_uri = $scheme . '://' . $host . $base_path; - $c->request->base( bless \$base_uri, $uri_class ); + $c->request->base( bless(\$base_uri, $uri_class)->canonical ); } =head2 $self->prepare_query_parameters($c)