From 87ca8e33893429fc1a549e032c03de5553d20752 Mon Sep 17 00:00:00 2001 From: leafee98 Date: Fri, 31 Mar 2023 15:15:25 +0800 Subject: [PATCH] Response "Non-implement" to GET endpoint --- main.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main.py b/main.py index 8983817..9d8198f 100755 --- a/main.py +++ b/main.py @@ -137,10 +137,10 @@ class S(BaseHTTPRequestHandler): self.send_header("Content-Type", "text/plaintext") self.end_headers() - # def do_GET(self): - # logging.info("GET request, Path=%s, Headers: %s", str(self.path), str(self.headers)) - # self._set_response() - # self.wfile.write("GET request for {}".format(self.path).encode("utf-8")) + def do_GET(self): + logging.info("Received GET request, Path: %s", str(self.path)) + content = "Non-implemented".encode("utf-8") + self._write_response(403, "text/plaintext", content) def _write_response(self, status_code: int, content_type: str, content: bytes): self.send_response(status_code)