Frontend: Fix redirect

This commit is contained in:
mrkubax10 2023-09-18 09:58:51 +02:00
parent bc37fcb2af
commit d89006fb46

View File

@ -446,8 +446,7 @@ sub sendResponse {
return;
}
given($aRequest->{"method"}) {
when(HTTP_METHOD_GET) {
if($aRequest->{"method"}==HTTP_METHOD_GET || $aRequest->{"method"}==HTTP_METHOD_POST) {
my $path = File::Spec->canonpath($aRequest->{"path"}{"url"});
if($path eq "/index.html" || $path eq "/index.htm") {
$path = "/";
@ -471,19 +470,9 @@ sub sendResponse {
$response.=$content;
$aClient->send($response);
}
when(HTTP_METHOD_POST) {
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 {
else {
sendNotImplemented($aClient);
}
}
}
sub createUser {