From 43dd3d1b44c36b5a8856140a03e0e904a1229749 Mon Sep 17 00:00:00 2001 From: Nova Date: Fri, 18 Apr 2025 22:03:30 +0200 Subject: [PATCH] Small #3 acknowlegdement in code --- pywebsrv.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pywebsrv.py b/pywebsrv.py index fa40f93..38babae 100644 --- a/pywebsrv.py +++ b/pywebsrv.py @@ -169,9 +169,11 @@ class RequestParser: Should (for now) only be GET as I haven't implemented the logic for PUT """ allowed_methods = ["GET"] - if os.path.isfile(self.allowed_methods_file): - with open(self.allowed_methods_file, "r") as f: - allowed_methods = [line.strip() for line in f] + # While the logic for PUT, DELETE, etc. is not added, we shouldn't + # allow for it to attempt it. + # if os.path.isfile(self.allowed_methods_file): + # with open(self.allowed_methods_file, "r") as f: + # allowed_methods = [line.strip() for line in f] return method in allowed_methods def host_parser(self, host): @@ -311,7 +313,7 @@ class WebServer: def handle_connection(self, conn, addr): try: - data = conn.recv(512) # why? well internet and tutiorials + data = conn.recv(512) request = data.decode(errors="ignore") response = self.handle_request(request, addr)