From cd3352e66c3fa6fe9ab34f4fc947e991f189f552 Mon Sep 17 00:00:00 2001 From: mungai-njoroge Date: Sun, 29 Oct 2023 12:29:58 +0300 Subject: [PATCH] comment out compression code --- Dockerfile | 2 ++ manage.py | 23 ++++++++++++----------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index a091d59..d3d1b98 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,5 @@ +LABEL org.opencontainers.image.description Removes client files compressions to fix plank page on safari + FROM ubuntu:latest WORKDIR / diff --git a/manage.py b/manage.py index ffbc541..b2c9af4 100644 --- a/manage.py +++ b/manage.py @@ -45,19 +45,20 @@ def serve_client_files(path: str): """ Serves the static files in the client folder. """ - js_or_css = path.endswith(".js") or path.endswith(".css") - if not js_or_css: - return app.send_static_file(path) + # js_or_css = path.endswith(".js") or path.endswith(".css") + # if not js_or_css: + # return app.send_static_file(path) - gzipped_path = path + ".gz" + # gzipped_path = path + ".gz" - if request.headers.get("Accept-Encoding", "").find("gzip") >= 0: - if os.path.exists(os.path.join(app.static_folder, gzipped_path)): - response = app.make_response(app.send_static_file(gzipped_path)) - response.headers["Content-Encoding"] = "gzip" - return response - else: - return app.send_static_file(path) + # if request.headers.get("Accept-Encoding", "").find("gzip") >= 0: + # if os.path.exists(os.path.join(app.static_folder, gzipped_path)): + # response = app.make_response(app.send_static_file(gzipped_path)) + # response.headers["Content-Encoding"] = "gzip" + # return response + # else: + # return app.send_static_file(path) + return app.send_static_file(path) @app.route("/")