[Catalyst-dev] RFC 3875, REQUEST_URI and PATH_INFO

danny-catalyst-dev at sadinoff.com danny-catalyst-dev at sadinoff.com
Wed Apr 21 23:30:43 GMT 2010


per bobtfish, I'm writing about the RFC3875 paragraph of
Catalyst/Engine/CGI.pm rev 13152 around line 152.

This new bit of code is harming the current mapping REQUEST_URI +
PATH_INFO => $base_uri, which is used for dispatch.

In particular, I've got a set of mod_rewrite config clauses, which are
getting misdirected by this new code.

http://paste.scsys.co.uk/42123

If I understand the situation correctly, bobtfish has broken my
redirects in an attempt to address issues surrounding the encoding of
slash-containing query parameters.  I have suggested to him that his
changes are hard to prove correct without a good spec for the above
mapping, and he's agreed to either remove the code or configure it off
by default.

for completeness, I've included the commenting-out bits that I used to
debug the problem.

Index: lib/Catalyst/Engine/CGI.pm
===================================================================
--- lib/Catalyst/Engine/CGI.pm  (revision 13152)
+++ lib/Catalyst/Engine/CGI.pm  (working copy)
@@ -156,6 +156,11 @@
     # Here we try to resurrect the original encoded URI from REQUEST_URI.
     my $path_info   = $ENV{PATH_INFO};
     if (my $req_uri = $ENV{REQUEST_URI}) {
+
+=pod
+
+disabled by djs
+
         $req_uri =~ s/^\Q$base_path\E//;
         $req_uri =~ s/\?.*$//;
         if ($req_uri && $req_uri ne '/') {
@@ -169,6 +174,9 @@
                 if $path_info_part;
             $path_info = $req_uri;
         }
+
+=cut
+
     }

     # set the request URI
@@ -199,7 +207,9 @@
     $base_path .= '/' unless $base_path =~ m{/$};

     my $base_uri = $scheme . '://' . $host . $base_path;
-
+      use Data::Dumper;
+      $c->log->debug(Data::Dumper->Dump([$ENV{REQUEST_URI},$ENV{SCRIPT_NAME},$ENV{PATH_INFO},$path, $base_path],
+                                       [qw(REQUEST_URI SCRIPT_NAME PATH_INFO path base_path )]));
     $c->request->base( bless \$base_uri, $uri_class );
 }





Cheers!

-- 
Danny Sadinoff
danny at sadinoff.com



More information about the Catalyst-dev mailing list