This commit is contained in:
Матвей
2026-10-16 11:48:49 +03:00
parent f2c4395693
commit 4aba163f7a
14 changed files with 284 additions and 14 deletions
+1 -1
View File
@@ -36,7 +36,7 @@ async def get_current_user(
if authorization is None or not authorization.startswith("Bearer "):
raise ApiError(401, "unauthorized", "Требуется Bearer-сессия", BEARER_CHALLENGE)
token = authorization[7:]
if not token or token.strip() != token:
if not token or not token.isascii() or token.strip() != token:
raise ApiError(401, "unauthorized", "Требуется Bearer-сессия", BEARER_CHALLENGE)
user = await store.user_for_token(token)
if user is None: