Different queue of middlewares

pull/268/head
kompotkot 2021-10-11 12:18:32 +00:00
rodzic 70b285a1ea
commit 43e8816780
1 zmienionych plików z 7 dodań i 7 usunięć

Wyświetl plik

@ -51,13 +51,6 @@ app = FastAPI(
redoc_url=f"/{DOCS_TARGET_PATH}", redoc_url=f"/{DOCS_TARGET_PATH}",
) )
app.add_middleware(
CORSMiddleware,
allow_origins=ORIGINS,
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
whitelist_paths: Dict[str, str] = {} whitelist_paths: Dict[str, str] = {}
whitelist_paths.update( whitelist_paths.update(
{ {
@ -75,6 +68,13 @@ whitelist_paths.update(
} }
) )
app.add_middleware(BroodAuthMiddleware, whitelist=whitelist_paths) app.add_middleware(BroodAuthMiddleware, whitelist=whitelist_paths)
app.add_middleware(
CORSMiddleware,
allow_origins=ORIGINS,
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
@app.get("/ping", response_model=data.PingResponse) @app.get("/ping", response_model=data.PingResponse)