Subject: | patch to CGI default page handling |
When using a system based on CGI::Maypole, if a user types:
http://localhost/cgi-bin/beer.cgi/
they see the frontpage of the database. But if they type
http://localhost/cgi-bin/beer.cgi
they see something like "Internal Server Error".
It seems unreasonable to penalise the user so hard for leaving off a
slash, so I've added a line to CGI::Maypole::parse_location():
--- CGI/Maypole.pm Thu Oct 28 14:16:08 2004
+++ CGI/Maypole.pm Mon Nov 29 14:43:44 2004
@@ -21,6 +21,7 @@
$self->{path} = $self->{cgi}->url( -absolute => 1, -path_info => 1 );
my $loc = $self->{cgi}->url( -absolute => 1 );
no warnings 'uninitialized';
+ $self->{path} .= '/' if $self->{path} eq $loc;
$self->{path} =~ s/^($loc)?\///;
$self->parse_path;
$self->parse_args;
It would be great if this can make it into the release.
Cheers, Dave
Message body not shown because it is not plain text.