about summary refs log tree commit diff
path: root/main.py
diff options
context:
space:
mode:
Diffstat (limited to 'main.py')
-rw-r--r--main.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/main.py b/main.py
index dc80db6..0844fd7 100644
--- a/main.py
+++ b/main.py
@@ -216,6 +216,7 @@ class HTTPServer:
             # get API version
             api_version = request.path.split("/")[1]
 
+            data = b''
             match api_version:
                 case "APIv1":
                     status, data = await APIv1.respond(client, request)
@@ -225,6 +226,10 @@ class HTTPServer:
             # if status is not 200 -> send bad response
             if status != 200:
                 await HTTPServer._bad_response(client, status)
+                return
+
+            # send data if no error
+            await HTTPServer._send(client, status, data)
 
             # return after answer
             return