Fix URI bug masked by HTTP::Request::AsCGI
Tomas Doran [Mon, 11 Jan 2010 23:18:08 +0000 (23:18 +0000)]
Changes
lib/Catalyst/Engine/CGI.pm

diff --git a/Changes b/Changes
index 176d54d..7f5aff0 100644 (file)
--- 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.
 
index 413ce11..c57c8a5 100644 (file)
@@ -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)