fix it for real this time

This commit is contained in:
Logan Joy-Koer
2026-08-27 05:53:08 -07:00
parent 52e3fc449d
commit 0a01a79e71
+1 -2
View File
@@ -18,8 +18,6 @@ ALLOWED_METHODS = {"GET", "POST", "HEAD", "PUT"}
script_directory = os.path.dirname(os.path.abspath(sys.argv[0])) script_directory = os.path.dirname(os.path.abspath(sys.argv[0]))
webroot_real = os.path.realpath(script_directory + "/webroot") webroot_real = os.path.realpath(script_directory + "/webroot")
requestType = ""
trying = True trying = True
while trying: while trying:
try: try:
@@ -384,6 +382,7 @@ def handle_connection(connectionSocket, addr):
response = ("HTTP/1.1 " + responseType + "\n").encode() response = ("HTTP/1.1 " + responseType + "\n").encode()
response += responseHeaders response += responseHeaders
response += b"\n" response += b"\n"
if requestType is None: requestType = "unknown"
if (requestType != "HEAD"): if (requestType != "HEAD"):
response += responsecontent response += responsecontent