♻️ Include FRONTEND_HOST in CORS origins by default (#1348)

This commit is contained in:
Sebastián Ramírez
2024-09-20 14:43:32 +02:00
committed by GitHub
parent a292dbe10d
commit e64c9100ec
2 changed files with 9 additions and 4 deletions

View File

@@ -38,6 +38,13 @@ class Settings(BaseSettings):
list[AnyUrl] | str, BeforeValidator(parse_cors)
] = []
@computed_field # type: ignore[prop-decorator]
@property
def all_cors_origins(self) -> list[str]:
return [str(origin).rstrip("/") for origin in self.BACKEND_CORS_ORIGINS] + [
self.FRONTEND_HOST
]
PROJECT_NAME: str
SENTRY_DSN: HttpUrl | None = None
POSTGRES_SERVER: str