X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=lib%2FApache%2FMVC.pm;fp=lib%2FApache%2FMVC.pm;h=d5909bf897daabe7fafc60ad3daab36ae555b5d4;hb=14afca2d074d51d7b8fd5306b39e24e06c3a517a;hp=e9caa396679f3f652745b9a6bdeb1432ed111b19;hpb=f59ec6e803f30a07c3d726c40fa0cffc2e669142;p=maypole.git diff --git a/lib/Apache/MVC.pm b/lib/Apache/MVC.pm index e9caa39..d5909bf 100644 --- a/lib/Apache/MVC.pm +++ b/lib/Apache/MVC.pm @@ -101,7 +101,7 @@ sub get_request { $self->ar($ar); } -=item parse_location +=item warn =cut @@ -116,7 +116,8 @@ sub warn { return; } -=item warn + +=item parse_location =cut @@ -131,13 +132,20 @@ sub parse_location { for (keys %headers) { $self->headers_in->set($_, $headers{$_}); } + my $path = $self->ar->uri; my $loc = $self->ar->location; + { no warnings 'uninitialized'; $path .= '/' if $path eq $loc; - $path =~ s/^($loc)?\///; + if ($loc =~ /\/$/) { + $path =~ s/^($loc)?//; + } else { + $path =~ s/^($loc)?\///; + } } + $self->path($path); $self->parse_path; $self->parse_args;