♻️ Refactor and update CORS, remove trailing slash from new Pydantic v2 (#617)
This commit is contained in:

committed by
GitHub

parent
53a0aebadf
commit
cfd66d2eee
@@ -20,7 +20,9 @@ app = FastAPI(
|
||||
if settings.BACKEND_CORS_ORIGINS:
|
||||
app.add_middleware(
|
||||
CORSMiddleware,
|
||||
allow_origins=[str(origin) for origin in settings.BACKEND_CORS_ORIGINS],
|
||||
allow_origins=[
|
||||
str(origin).strip("/") for origin in settings.BACKEND_CORS_ORIGINS
|
||||
],
|
||||
allow_credentials=True,
|
||||
allow_methods=["*"],
|
||||
allow_headers=["*"],
|
||||
|
Reference in New Issue
Block a user