mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-01-19 09:38:21 +08:00
👽 update auth header
This commit is contained in:
parent
4f6f99146c
commit
5d08d53c27
@ -30,7 +30,7 @@ def get_auth_bearer(access_token: Optional[str] = Header(
|
|||||||
if not access_token:
|
if not access_token:
|
||||||
return None
|
return None
|
||||||
scheme, _, param = access_token.partition(" ")
|
scheme, _, param = access_token.partition(" ")
|
||||||
if scheme.lower() != "bearer":
|
if scheme.lower() not in ["bearer", "token"]:
|
||||||
raise HTTPException(status_code=status.HTTP_401_UNAUTHORIZED,
|
raise HTTPException(status_code=status.HTTP_401_UNAUTHORIZED,
|
||||||
detail="Not authenticated",
|
detail="Not authenticated",
|
||||||
headers={"WWW-Authenticate": "Bearer"})
|
headers={"WWW-Authenticate": "Bearer"})
|
||||||
|
Loading…
Reference in New Issue
Block a user