From d89006fb466ad08e9a112213a30a0ddb065a6e46 Mon Sep 17 00:00:00 2001 From: mrkubax10 Date: Mon, 18 Sep 2023 09:58:51 +0200 Subject: [PATCH] Frontend: Fix redirect --- frontend.pm | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/frontend.pm b/frontend.pm index b553003..ab2ac01 100644 --- a/frontend.pm +++ b/frontend.pm @@ -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 {