diff options
Diffstat (limited to 'main.py')
| -rw-r--r-- | main.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/main.py b/main.py index 75f9064..8760d15 100644 --- a/main.py +++ b/main.py @@ -208,12 +208,17 @@ class HTTPServer: data = minimize_html(data) if request.type == "GET": - return Response(data, STATUS_CODE_OK) + response = Response(data, STATUS_CODE_OK) elif request.type == "HEAD": - return Response(b'', STATUS_CODE_OK, {"Content-Length": len(data)}) + response = Response(b'', STATUS_CODE_OK, {"Content-Length": len(data)}) else: raise TypeError("Called GET handler for non-GET request") + if filepath[-4:] == "webp": + response.compress = False + + return response + elif len(split_path) >= 2 and split_path[0] in API_VERSIONS: # assume script # unsupported API version if not API_VERSIONS[split_path[0]]: |