From 2778b7de51e0c732e295c7ace4ce4a7e400d25b4 Mon Sep 17 00:00:00 2001 From: UltraQbik Date: Tue, 20 Aug 2024 18:54:35 +0300 Subject: Add comments --- main.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'main.py') 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 -- cgit 1.4.1