allow all origins for cors

This commit is contained in:
Dave 2025-05-31 14:11:42 +01:00
parent a9210ca8ed
commit 152286eb92
2 changed files with 1 additions and 2 deletions

View File

@ -8,7 +8,7 @@ class Settings(BaseSettings):
VERSION: str = "0.1.0" VERSION: str = "0.1.0"
# CORS Configuration # CORS Configuration
BACKEND_CORS_ORIGINS: list[str | AnyHttpUrl] = [] BACKEND_CORS_ORIGINS: list[str | AnyHttpUrl] = ['*']
@validator("BACKEND_CORS_ORIGINS", pre=True) @validator("BACKEND_CORS_ORIGINS", pre=True)
def assemble_cors_origins(self, v: str | list[str]) -> list[str] | str: def assemble_cors_origins(self, v: str | list[str]) -> list[str] | str:

View File

@ -62,7 +62,6 @@ if settings.BACKEND_CORS_ORIGINS:
app.add_middleware( app.add_middleware(
CORSMiddleware, CORSMiddleware,
allow_origins=[str(origin) for origin in settings.BACKEND_CORS_ORIGINS], allow_origins=[str(origin) for origin in settings.BACKEND_CORS_ORIGINS],
allow_credentials=True,
allow_methods=["*"], allow_methods=["*"],
allow_headers=["*"], allow_headers=["*"],
) )