From 5d08d53c27e17ffc5ff533644e6ba4bac99a1c75 Mon Sep 17 00:00:00 2001 From: yanyongyu Date: Sun, 25 Oct 2020 14:42:46 +0800 Subject: [PATCH] :alien: update auth header --- nonebot/drivers/fastapi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nonebot/drivers/fastapi.py b/nonebot/drivers/fastapi.py index b8c9ccbe..bb0009b4 100644 --- a/nonebot/drivers/fastapi.py +++ b/nonebot/drivers/fastapi.py @@ -30,7 +30,7 @@ def get_auth_bearer(access_token: Optional[str] = Header( if not access_token: return None scheme, _, param = access_token.partition(" ") - if scheme.lower() != "bearer": + if scheme.lower() not in ["bearer", "token"]: raise HTTPException(status_code=status.HTTP_401_UNAUTHORIZED, detail="Not authenticated", headers={"WWW-Authenticate": "Bearer"})