From 28ef9b9cd6cd6e301a08952c8fda35603c9eb6cb Mon Sep 17 00:00:00 2001 From: UltraQbik Date: Thu, 22 Aug 2024 18:10:15 +0300 Subject: Move thing up --- src/request.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/request.py') diff --git a/src/request.py b/src/request.py index 56f67be..0437dfd 100644 --- a/src/request.py +++ b/src/request.py @@ -23,6 +23,9 @@ class Request: request.type = raw_request[:raw_request.find(b' ')].decode("ascii") raw_path = raw_request[len(request.type)+1:raw_request.find(b' ', len(request.type)+1)].decode("ascii") + # remove path args from path + request.path = raw_path.split("?")[0] + # decode path args raw_args = raw_path.split("/")[-1].split("?") raw_args = raw_args[1] if len(raw_args) == 2 else "" @@ -37,9 +40,6 @@ class Request: elif len(split) == 1 and split[0] != "": request.path_args[split[0]] = None - # remove path args from path - request.path = raw_path.split("?")[0] - # decode headers for raw_header in raw_request.split(b'\r\n'): if len(pair := raw_header.decode("ascii").split(":")) == 2: -- cgit 1.4.1