Update main.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>pull/58/head
parent
f165cf3e2e
commit
8ac7d02362
6
main.py
6
main.py
|
|
@ -56,7 +56,11 @@ def check_napcat_server_token(conn, request):
|
||||||
return None
|
return None
|
||||||
auth_header = request.headers.get("Authorization")
|
auth_header = request.headers.get("Authorization")
|
||||||
if auth_header != f"Bearer {token}":
|
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
|
return None
|
||||||
|
|
||||||
async def napcat_server():
|
async def napcat_server():
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue