diff options
| author | UltraQbik <no1skill@yandex.ru> | 2024-08-20 18:54:35 +0300 |
|---|---|---|
| committer | UltraQbik <no1skill@yandex.ru> | 2024-08-20 18:54:35 +0300 |
| commit | 2778b7de51e0c732e295c7ace4ce4a7e400d25b4 (patch) | |
| tree | be36431d0ed895226a7b9c9c9d0d629452a1b61a | |
| parent | 66b129b33d4348c97b4c6817df55fc27cbb7cb3d (diff) | |
| download | httpy-2778b7de51e0c732e295c7ace4ce4a7e400d25b4.tar.gz httpy-2778b7de51e0c732e295c7ace4ce4a7e400d25b4.zip | |
Add comments
| -rw-r--r-- | main.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/main.py b/main.py index 6f824da..39ae8f3 100644 --- a/main.py +++ b/main.py @@ -157,6 +157,8 @@ class HTTPServer: # break the connection break + + # close connection (stop page loading) self._close_client(client) @staticmethod @@ -172,8 +174,11 @@ class HTTPServer: # if it is -> return file from that path async with aiofiles.open(PATH_MAP[request.path]["path"], "rb") as f: data = await f.read() + + # send 200 response with the file to the client HTTPServer._send(client, 200, data) else: + # send 400 response to the client HTTPServer._send(client, 400) @staticmethod |