about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUltraQbik <no1skill@yandex.ru>2024-08-20 18:54:35 +0300
committerUltraQbik <no1skill@yandex.ru>2024-08-20 18:54:35 +0300
commit2778b7de51e0c732e295c7ace4ce4a7e400d25b4 (patch)
treebe36431d0ed895226a7b9c9c9d0d629452a1b61a
parent66b129b33d4348c97b4c6817df55fc27cbb7cb3d (diff)
downloadhttpy-2778b7de51e0c732e295c7ace4ce4a7e400d25b4.tar.gz
httpy-2778b7de51e0c732e295c7ace4ce4a7e400d25b4.zip
Add comments
-rw-r--r--main.py5
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