diff options
| author | UltraQbik <no1skill@yandex.ru> | 2024-08-22 18:10:15 +0300 |
|---|---|---|
| committer | UltraQbik <no1skill@yandex.ru> | 2024-08-22 18:10:15 +0300 |
| commit | 28ef9b9cd6cd6e301a08952c8fda35603c9eb6cb (patch) | |
| tree | 009bbf42123a3e005c6546ae1ea191cd00c018fb /src | |
| parent | d64582eee40b9e87fcb64299b88cb58ad8289311 (diff) | |
| download | httpy-28ef9b9cd6cd6e301a08952c8fda35603c9eb6cb.tar.gz httpy-28ef9b9cd6cd6e301a08952c8fda35603c9eb6cb.zip | |
Move thing up
Diffstat (limited to 'src')
| -rw-r--r-- | src/request.py | 6 |
1 files changed, 3 insertions, 3 deletions
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: |