]> git.decadent.org.uk Git - maypole.git/blobdiff - lib/Apache/MVC.pm
fix to bug in Apache::MVC location handling
[maypole.git] / lib / Apache / MVC.pm
index e9caa396679f3f652745b9a6bdeb1432ed111b19..d5909bf897daabe7fafc60ad3daab36ae555b5d4 100644 (file)
@@ -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;