]> mj.ucw.cz Git - pciids.git/commitdiff
Allow strange urls
authorMichal 'vorner' Vaner <vorner@ucw.cz>
Fri, 23 Apr 2010 21:16:35 +0000 (23:16 +0200)
committerMichal 'vorner' Vaner <vorner@ucw.cz>
Fri, 23 Apr 2010 21:16:35 +0000 (23:16 +0200)
PciIds/Html/Handler.pm

index f9ca889e5dd2830b303ac5e642ab7f2a3fd89911..b1fb9fc61edcc46185a84dc9c9d028fc0c0c441d 100644 (file)
@@ -85,6 +85,9 @@ sub handler( $$ ) {
        my $action = $args->{'action'};
        $action = '' unless( defined $action );
        return HTTPRedirect( $req, protoName( $hasSSL ).'://'.$req->hostname().'/' ) if $req->uri() =~ /^\/(read|mods)\/?$/  && ( $action eq '' || $action eq 'list' );
+       my $uri = $req->uri();
+       $uri =~ s/(mods|read)\/\?/$1\/?PC\//;
+       return HTTPRedirect( $req, protoName( $hasSSL ).'://'.$req->hostname().'/'.$uri ) if $req->uri() =~ /^(read|mods)\/?/;
        my $method = $handlers{$req->method()};
        return HTTP_METHOD_NOT_ALLOWED unless( defined $method );#Can't handle this method
        my $sub = $method->{$action};