mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-18 09:04:28 +03:00
Simplify
This commit is contained in:
parent
ee902855bf
commit
5eb691c665
@ -70,9 +70,7 @@ def create_fastapi_app(
|
|||||||
@app.middleware("http")
|
@app.middleware("http")
|
||||||
async def frigate_middleware(request: Request, call_next):
|
async def frigate_middleware(request: Request, call_next):
|
||||||
# Before request
|
# Before request
|
||||||
csrf_passed = check_csrf(request)
|
if not check_csrf(request):
|
||||||
|
|
||||||
if not csrf_passed:
|
|
||||||
return JSONResponse(
|
return JSONResponse(
|
||||||
content={"success": False, "message": "Missing CSRF header"},
|
content={"success": False, "message": "Missing CSRF header"},
|
||||||
status_code=401,
|
status_code=401,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user