From 3cb29002df562aaf8fc84ba23e20eaab89da771e Mon Sep 17 00:00:00 2001 From: Roberto Alsina Date: Tue, 16 May 2023 14:01:04 -0300 Subject: [PATCH] Handle empty requests for ping, add a bit of styling --- tapas/handler.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tapas/handler.py b/tapas/handler.py index 45576f2..d02cbdf 100644 --- a/tapas/handler.py +++ b/tapas/handler.py @@ -15,6 +15,8 @@ def handle(req): "author": "bat", } """ + if not req: + return "Foo", 200, {"Content-Type": "text/plain"} try: args = loads(req) except Exception: @@ -25,7 +27,7 @@ def handle(req): c.image.save(byte_arr, format="JPEG") return ( - f'', + f'', 200, {"Content-Type": "text/html"}, )