Изменения мидлваре

This commit is contained in:
urec56 2024-06-07 13:54:14 +05:00
parent 4dc2fc58b1
commit 018d6bc0c2

View file

@ -47,6 +47,7 @@ app.mount("/static", StaticFiles(directory="app/static"), name="static")
class AddHeaderMiddleware(BaseHTTPMiddleware):
async def dispatch(self, request: Request, call_next):
logging.critical(f"Запрос \n{request.headers.get("Sec-Websocket-Protocol", "НИХУЯ")}")
logging.critical(f"Запрос {request.headers}")
response = await call_next(request)
logging.critical(f"Ответ \n {response.headers.get("Sec-Websocket-Protocol", "НИХУЯ")}")
if "Sec-Websocket-Protocol" in request.headers: