From 08a613db3303f2cf229d5b080e0a39c4c31636f6 Mon Sep 17 00:00:00 2001 From: sgrtye Date: Tue, 2 Apr 2024 21:19:12 +0100 Subject: [PATCH] update response body --- novel/main.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/novel/main.py b/novel/main.py index e274f7f..742c78a 100644 --- a/novel/main.py +++ b/novel/main.py @@ -123,12 +123,13 @@ def do_GET(self): elif self.path == "/health": if time.time() - last_updated_time > loop_time: self.send_response(500) - self.wfile.write(b"Delayed") + response = json.dumps({"status": "delayed"}) else: self.send_response(200) - self.wfile.write(b"OK") + response = json.dumps({"status": "ok"}) self.send_header("Content-type", "application/json") self.end_headers() + self.wfile.write(response.encode("utf-8")) else: self.send_response(404) self.send_header("Content-type", "text/plain")