From 0e486babb7bfeef90ff2a3a5f9cc5f1edaa840b6 Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Thu, 29 Aug 2024 21:35:12 -0400 Subject: [PATCH] Use header to expose healthcheck status instead of status code This is mostly to prevent it sending me emails on every GET of the page when erroring --- cmsmanage/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmsmanage/views.py b/cmsmanage/views.py index 9b8c4be..5170432 100644 --- a/cmsmanage/views.py +++ b/cmsmanage/views.py @@ -88,5 +88,5 @@ def healthcheck(request: HttpRequest): return HttpResponse( ("OK: " if all_ok else "CRITICAL: ") + "\n".join(messages), content_type="text/plain", - status=200 if all_ok else 500, + headers={"X-CMSManage-Status": "OK"}, )