
domatidealx.com
Jun 29, 2005, 8:03 PM
Post #1 of 1
(217 views)
Permalink
|
|
[PATCH] Misbehavior w/ URI and slashes
|
|
Catalyst treats differently http://localhost:3000/application//edit/42 and http://localhost:3000/application/edit/42 . It really shouldn't. Here is the patch, although I am under the impression that more bugs lie in this area and that the "URI" module (already a dependency) does this and then some... Regards and thanks for your work! -- Dominique QUATRAVAUX Ing?nieur senior 01 44 42 00 08 IDEALX -------------- next part -------------- Index: lib/Catalyst/Engine/HTTP/Base.pm =================================================================== --- lib/Catalyst/Engine/HTTP/Base.pm (revision 932) +++ lib/Catalyst/Engine/HTTP/Base.pm (working copy) @@ -172,7 +172,8 @@ my $path = $c->http->request->uri->path || '/'; $path =~ s/%([0-9A-Fa-f]{2})/chr(hex($1))/eg; - $path =~ s/^\///; + $path =~ s|/+|/|g; + $path =~ s|^/||; $c->req->base($base); $c->req->path($path);
|