From 8ac7d023620f61bfcd390e31d184c4fffc1cafe5 Mon Sep 17 00:00:00 2001 From: UnCLAS-Prommer <53261159+UnCLAS-Prommer@users.noreply.github.com> Date: Sat, 13 Sep 2025 13:42:44 +0800 Subject: [PATCH] Update main.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- main.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 66525af..6f824a6 100644 --- a/main.py +++ b/main.py @@ -56,7 +56,11 @@ def check_napcat_server_token(conn, request): return None auth_header = request.headers.get("Authorization") if auth_header != f"Bearer {token}": - return Server.Response(http.HTTPStatus.UNAUTHORIZED, "", headers=Server.Headers([("Content-Type", "text/plain")]), body=b"Unauthorized\n") + return Server.Response( + status=http.HTTPStatus.UNAUTHORIZED, + headers=Server.Headers([("Content-Type", "text/plain")]), + body=b"Unauthorized\n" + ) return None async def napcat_server():