fix header response

This commit is contained in:
Skillet 2023-08-13 18:11:45 -04:00
parent 431eaab7c8
commit 878383af12

View File

@ -17,6 +17,9 @@ class serveRA(http.server.SimpleHTTPRequestHandler):
def do_GET(self): def do_GET(self):
query = parse_qs(urlparse(self.path).query) query = parse_qs(urlparse(self.path).query)
if 'grpName' in query: if 'grpName' in query:
self.send_response(200)
self.send_header("Content-type", "text")
self.end_headers()
grpName = query['grpName'][0] grpName = query['grpName'][0]
grpfile = "./" grpfile = "./"
if os.path.exists(f"./wlgrps/{grpName}.cfg"): if os.path.exists(f"./wlgrps/{grpName}.cfg"):
@ -56,10 +59,6 @@ class serveRA(http.server.SimpleHTTPRequestHandler):
except: except:
print('failed to serve file!', file=stderr) print('failed to serve file!', file=stderr)
print(traceback.format_exc(), file=stderr) print(traceback.format_exc(), file=stderr)
self.send_response(200)
self.send_header("Content-type", "text")
self.end_headers()
else: else:
self.send_response(404) self.send_response(404)
return return