From 878383af128208185f9f4ced79df7b720396883a Mon Sep 17 00:00:00 2001 From: Skillet Date: Sun, 13 Aug 2023 18:11:45 -0400 Subject: [PATCH] fix header response --- simpleFileServer.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/simpleFileServer.py b/simpleFileServer.py index 6ff51f6..112e7f7 100644 --- a/simpleFileServer.py +++ b/simpleFileServer.py @@ -17,6 +17,9 @@ class serveRA(http.server.SimpleHTTPRequestHandler): def do_GET(self): query = parse_qs(urlparse(self.path).query) if 'grpName' in query: + self.send_response(200) + self.send_header("Content-type", "text") + self.end_headers() grpName = query['grpName'][0] grpfile = "./" if os.path.exists(f"./wlgrps/{grpName}.cfg"): @@ -56,10 +59,6 @@ class serveRA(http.server.SimpleHTTPRequestHandler): except: print('failed to serve file!', file=stderr) print(traceback.format_exc(), file=stderr) - - self.send_response(200) - self.send_header("Content-type", "text") - self.end_headers() else: self.send_response(404) return