Frontend: Fix redirect
This commit is contained in:
parent
bc37fcb2af
commit
d89006fb46
15
frontend.pm
15
frontend.pm
@ -446,8 +446,7 @@ sub sendResponse {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
given($aRequest->{"method"}) {
|
if($aRequest->{"method"}==HTTP_METHOD_GET || $aRequest->{"method"}==HTTP_METHOD_POST) {
|
||||||
when(HTTP_METHOD_GET) {
|
|
||||||
my $path = File::Spec->canonpath($aRequest->{"path"}{"url"});
|
my $path = File::Spec->canonpath($aRequest->{"path"}{"url"});
|
||||||
if($path eq "/index.html" || $path eq "/index.htm") {
|
if($path eq "/index.html" || $path eq "/index.htm") {
|
||||||
$path = "/";
|
$path = "/";
|
||||||
@ -471,19 +470,9 @@ sub sendResponse {
|
|||||||
$response.=$content;
|
$response.=$content;
|
||||||
$aClient->send($response);
|
$aClient->send($response);
|
||||||
}
|
}
|
||||||
when(HTTP_METHOD_POST) {
|
else {
|
||||||
my $path = File::Spec->canonpath($aRequest->{"path"}{"url"});
|
|
||||||
if($path eq "/index.html" || $path eq "/index.htm") {
|
|
||||||
$path = "/";
|
|
||||||
}
|
|
||||||
if(!frontend_routes::handlePath($aClient, $path, $aRequest, $aConnection)) {
|
|
||||||
sendNotFound($aClient);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
default {
|
|
||||||
sendNotImplemented($aClient);
|
sendNotImplemented($aClient);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sub createUser {
|
sub createUser {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user