[Catalyst] Plack::Hanlder::FCGI Bug?

Josef Chladek josef.chladek at gmail.com
Tue Oct 25 13:27:53 GMT 2011

(sorry for crossposting to psgi-plack and catalyst-list)


we run the latest of Catalyst (5.90005), have our app mounted under /myapp attached to apache2 via fastcgi. The problem just occurred after upgrading from the non-plack-catalyst (5.80027).

the problem now is, that rewrite rules (PassThrough) for apache result in bad paths in catalyst. for example:

/foo has the rewrite rule in apache to /myapp/somecontroller/method

gets correctly rewritten in apache but gets transformed to /foo in Plack/Handler/FCGI.pm. The reason for this are the lines around linenumber 110:

# lighttpd munges multiple slashes in PATH_INFO into one. Try recovering it
my $uri = URI->new("http://localhost" .  $env->{REQUEST_URI});
$env->{PATH_INFO} = uri_unescape($uri->path);
$env->{PATH_INFO} =~ s/^\Q$env->{SCRIPT_NAME}\E//;

If I comment this block out, the correct PATH_INFO somecontroller/method is called.
An if around this block
 if ($env->{SERVER_SOFTWARE} && $env->{SERVER_SOFTWARE} =~ m!lighttpd!) 
would be the solution, I guess...


More information about the Catalyst mailing list