From: Michal 'vorner' Vaner Date: Fri, 23 Apr 2010 21:16:35 +0000 (+0200) Subject: Allow strange urls X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=fe914f97c86f4af82949e1ed6242271fc236dde8;p=pciids.git Allow strange urls --- diff --git a/PciIds/Html/Handler.pm b/PciIds/Html/Handler.pm index f9ca889..b1fb9fc 100644 --- a/PciIds/Html/Handler.pm +++ b/PciIds/Html/Handler.pm @@ -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};