diff --git a/server.py b/server.py index 940e6ef..a844385 100644 --- a/server.py +++ b/server.py @@ -18,6 +18,8 @@ ALLOWED_METHODS = {"GET", "POST", "HEAD", "PUT"} script_directory = os.path.dirname(os.path.abspath(sys.argv[0])) webroot_real = os.path.realpath(script_directory + "/webroot") +requestType = "" + trying = True while trying: try: @@ -323,8 +325,8 @@ def handle_connection(connectionSocket, addr): fullRequestPath = script_directory + "/webroot/404.html" plainresponse = False - extensions = [ ".html", ".json", ".png", ".gif", ".ico", ".jpg", ".css", ".txt", ".ttf", ".mp4", ".gz", ".img"] - contentTypes = ["text/html", "text/json", "image/png", "image/gif", "image/x-icon", "image/jpeg", "text/css", "text/plain", "application/octet-stream", "video/mp4", "application/gzip", "application/octet-stream"] + extensions = [ ".html", ".json", ".png", ".gif", ".ico", ".jpg", ".css", ".txt", ".ttf", ".mp4", ".gz", ".img", ".cci"] + contentTypes = ["text/html", "text/json", "image/png", "image/gif", "image/x-icon", "image/jpeg", "text/css", "text/plain", "application/octet-stream", "video/mp4", "application/gzip", "application/octet-stream","application/octet-stream"] for i in range(len(extensions)): if fullRequestPath.endswith(extensions[i]): plainresponse = True