X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=lib%2FCGI%2FMaypole.pm;h=dda15fcd7a52df6c8dabd3616b4bb22223d1e77a;hb=ac7eb8f3a1780223d5376e623ab90af3c8f83f04;hp=b8a0a48d3d40d6351f00d4533c0ca16e2953ab59;hpb=12d8a77a713d5ed4f08414e5f34e96d45f60e2d3;p=maypole.git diff --git a/lib/CGI/Maypole.pm b/lib/CGI/Maypole.pm index b8a0a48..dda15fc 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)); } + $r->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,17 @@ sub parse_location $r->parse_args; } +=item warn + +=cut + +sub warn { + my ($self,@args) = @_; + my ($package, $line) = (caller)[0,2]; + warn "[$package line $line] ", @args ; + return; +} + =item parse_args =cut