From 9537eef58d14101e744f229fa5e1baec2a4b6d8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Gruszczy=C5=84ski?= Date: Wed, 24 Dec 2025 22:38:15 +0100 Subject: [PATCH] cahce on /healthcheck --- app.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/app.py b/app.py index 73a2677..e452d1e 100644 --- a/app.py +++ b/app.py @@ -1565,6 +1565,13 @@ def apply_headers(response): response.headers["Vary"] = "Accept-Encoding" return response + # --- healthcheck --- + if request.path == '/healthcheck': + response.headers['Cache-Control'] = 'no-store, no-cache' + response.headers.pop('ETag', None) + response.headers.pop('Vary', None) + return response + # --- redirecty --- if response.status_code in (301, 302, 303, 307, 308): response.headers["Cache-Control"] = "no-store" @@ -4102,10 +4109,15 @@ def admin_lists_access(list_id=None): def healthcheck(): header_token = request.headers.get("X-Internal-Check") correct_token = app.config.get("HEALTHCHECK_TOKEN") - + if header_token != correct_token: abort(404) - return "OK", 200 + + response_data = { + "status": "OK", + } + + return response_data, 200 @app.route("/admin/settings", methods=["GET", "POST"])