From 1a41160ce590d689aacdcb815790329dd4aecf10 Mon Sep 17 00:00:00 2001 From: Michal Vaner Date: Mon, 8 Sep 2008 23:57:02 +0200 Subject: [PATCH] Make login on /read work --- PciIds/Html/Handler.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PciIds/Html/Handler.pm b/PciIds/Html/Handler.pm index dde09bb..100726c 100644 --- a/PciIds/Html/Handler.pm +++ b/PciIds/Html/Handler.pm @@ -80,10 +80,11 @@ my %handlers = ( sub handler( $$ ) { my( $req, $hasSSL ) = @_; my $args = parseArgs( $req->args() ); - return HTTPRedirect( $req, $req->uri()."index.html" ) if( $req->uri() eq '/' && ( !defined $args->{'action'} || $args->{'action'} ne 'help' ) ); + return HTTPRedirect( $req, protoName( $hasSSL ).'://'.$req->hostname().'/index.html' ) if( $req->uri() eq '/' && ( !defined $args->{'action'} || $args->{'action'} ne 'help' ) ); return DECLINED if( $req->uri() =~ /^\/((static)\/|robots.txt|index.html)/ ); 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 $method = $handlers{$req->method()}; return HTTP_METHOD_NOT_ALLOWED unless( defined $method );#Can't handle this method my $sub = $method->{$action}; -- 2.39.2