Merge branch 'action_args'
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Engine / CGI.pm
index 9df1444..1443a2f 100644 (file)
@@ -167,7 +167,7 @@ sub prepare_path {
             # incorrect.
             if (substr($req_uri, 0, 1) ne '/') {
                 my ($match) = $req_uri =~ m|^([^/]+)|;
-                my ($path_info_part) = $path_info =~ m|^(.*?$match)|;
+                my ($path_info_part) = $path_info =~ m|^(.*?\Q$match\E)|;
                 substr($req_uri, 0, length($match), $path_info_part);
             }
             $path_info = $req_uri;
@@ -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