Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Catalyst: Dev

Mangled URI with escapes in Catalyst::Engine::FastCGI (lighttpd)

 

 

Catalyst dev RSS feed   Index | Next | Previous | View Threaded


mail at vipul

Jan 28, 2008, 6:28 PM

Post #1 of 1 (933 views)
Permalink
Mangled URI with escapes in Catalyst::Engine::FastCGI (lighttpd)

The following snippet is from Catalyst::Engine::FastCGI -

while ( $request->Accept >= 0 ) {
$proc_manager && $proc_manager->pm_pre_dispatch();

# If we're running under Lighttpd, swap PATH_INFO and
SCRIPT_NAME
# http://lists.rawmode.org/pipermail/catalyst/2006-June/008361.html
# Thanks to Mark Blythe for this fix
if ( $env{SERVER_SOFTWARE} && $env{SERVER_SOFTWARE} =~ /
lighttpd/ ) {
$env{PATH_INFO} ||= delete $env{SCRIPT_NAME};
}

$class->handle_request( env => \%env );

$proc_manager && $proc_manager->pm_post_dispatch();
}

Line 142, $env{PATH_INFO} is set to $env{SCRIPT_NAME}.
$env{SCRIPT_NAME} seems to be strangely mangled when the original URI
contains CGI escapes. For instance:

http://example.com/url/http%3A%2F%2Ffoo.com
becomes
http://example.com/url/http:/foo.com ( single / after http: )

I don't know enough about Catalyst internals to know why this happens
or why the assignment to $env{SCRIPT_NAME} is used. I changed line
142 here to use $env{REQUEST_URI} instead, which fixes this problem -
though I am not sure if it creates others.

I'd appreciate some insight on this.

cheers,
vipul


_______________________________________________
Catalyst-dev mailing list
Catalyst-dev [at] lists
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst-dev

Catalyst dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.