fix: random exceptions inside logs in middleware (#2608)

closes #2599

special thanks to bitkarrot for figuring that out, it was actually
initialized twice, the decorator alone is enough!

also was issue for first_install middleware
This commit is contained in:
dni ⚡ 2024-07-31 12:00:40 +02:00 committed by GitHub
parent ffba71c0ce
commit b0a66e8cf5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -214,8 +214,6 @@ def add_ip_block_middleware(app: FastAPI):
)
return await call_next(request)
app.middleware("http")(block_allow_ip_middleware)
def add_first_install_middleware(app: FastAPI):
@app.middleware("http")
@ -228,5 +226,3 @@ def add_first_install_middleware(app: FastAPI):
):
return RedirectResponse("/first_install")
return await call_next(request)
app.middleware("http")(first_install_middleware)