> > If somebody could write this up for Engine::FastCGI in the form of a patch 
I'm
> > sure it could ship in 5.7002

If anybody is interested, I've attached the tiny plugin I wrote to
solve this issue for Lighttpd.  I've been using this for local
development for several months.  I agree, it'd be best to patch the
engine if it can be done in a way that works for "all" webservers.  I
don't yet have the free time to test with Apache as well.
package Catalyst::Plugin::Lighttpd;

# $Id$

BEGIN {
        our $VERSION = (split(' ', q$Revision$))[1];
}

use strict;

sub handle_request {
        my ($class, %args) = @_;

        if (exists $args{env}) {
                # lighttpd seems to report these backward
                $args{env}{PATH_INFO} ||= delete $args{env}{SCRIPT_NAME};
        }

        $class->NEXT::handle_request(%args);
}

1;

=head1 NAME

Catalyst::Plugin::Lighttpd - Fix Lighttpd path info

=head1 SYNOPSIS

  use Catalyst qw(Lighttpd);

=head1 DESCRIPTION

Lighttpd seems to report PATH_INFO and SCRIPT_NAME differently than Apache and
most other web servers.  This causes Catalyst to always route URLs with trailing
slashes to the application's default action.

This plugin will fix that.
_______________________________________________
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/

Reply via email to