Merge pull request 'up' (#4) from master into dev

Reviewed-on: #4
This commit is contained in:
emmatveev 2024-11-17 02:35:32 +03:00
commit 2eba8e91e7

View File

@ -19,7 +19,7 @@ async def check_token(request: fastapi.Request, call_next):
if QUEUES_TOKEN: if QUEUES_TOKEN:
token = request.headers.get('X-Queues-Token') token = request.headers.get('X-Queues-Token')
if not token or token != QUEUES_TOKEN: if not token or token != QUEUES_TOKEN:
raise fastapi.HTTPException(403) return fastapi.JSONResponse(status_code=403, content={'message': 'token is not provided or incorrect'})
return await call_next(request) return await call_next(request)