[Catalyst] Patch for Engine/CGI.pm
    Bill Moseley 
    moseley at hank.org
       
    Wed Dec 14 22:30:13 CET 2005
    
    
  
http://localhost:3000/
    $c->req->uri->path == '/'
http://localhost:3000/?foo=bar
    $c->req->uri->path == ''
I'm not sure if this is the right fix because without any comment in
the code I was not sure what the intent of the original substitution
was below. I assume it was to remove extra slashes.
Index: lib/Catalyst/Engine/CGI.pm
===================================================================
--- lib/Catalyst/Engine/CGI.pm  (revision 2689)
+++ lib/Catalyst/Engine/CGI.pm  (working copy)
@@ -138,7 +138,7 @@
     }
 
     my $path = $base_path . ( $ENV{PATH_INFO} || '' );
-    $path =~ s{^/+}{};
+    $path =~ s[^/{2,}][/];  # Avoid duplicate slashes
 
     my $uri = URI->new;
     $uri->scheme($scheme);
I tried to add a test to t/live_engine_request_uri.t, but I'd need to
modify the test application to return something else for the "root
index" -- and t/live_component_controller_action_index.t depends on
that return.  Hence, no test case was added for this.
-- 
Bill Moseley
moseley at hank.org
    
    
More information about the Catalyst
mailing list