X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=lib%2FCGI%2FMaypole.pm;h=5fd736d3e25681cd240c61d2d233252e46e0c613;hb=0ce03c9aa8e988d951a1383c99287d5ca4fbdfba;hp=d223c768c335b20e85d10af609fd0c271498c339;hpb=32ecafee815b0fd8043c0acc2c785f5748fc20ff;p=maypole.git diff --git a/lib/CGI/Maypole.pm b/lib/CGI/Maypole.pm index d223c76..5fd736d 100644 --- a/lib/CGI/Maypole.pm +++ b/lib/CGI/Maypole.pm @@ -92,12 +92,18 @@ sub parse_location $r->headers_in->set($field_name => $cgi->http($http_header)); } + $self->preprocess_location(); + my $path = $cgi->url( -absolute => 1, -path_info => 1 ); my $loc = $cgi->url( -absolute => 1 ); { no warnings 'uninitialized'; $path .= '/' if $path eq $loc; - $path =~ s/^($loc)?\///; + if ($loc =~ /\/$/) { + $path =~ s/^($loc)?//; + } else { + $path =~ s/^($loc)?\///; + } } $r->path($path); @@ -105,6 +111,10 @@ sub parse_location $r->parse_args; } +=item warn + +=cut + sub warn { my ($self,@args) = @_; my ($package, $line) = (caller)[0,2];