We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 78781ef commit be43e42Copy full SHA for be43e42
backend/app/core/config.py
@@ -60,6 +60,7 @@ def server_host(self) -> str:
60
BACKEND_CORS_ORIGINS: Annotated[
61
list[AnyUrl] | str, BeforeValidator(parse_cors)
62
] = []
63
+ BACKEND_CORS_ORIGIN_REGEXP: str | None = None
64
65
PROJECT_NAME: str = "TiDB.AI"
66
SENTRY_DSN: HttpUrl | None = None
backend/main.py
@@ -93,6 +93,7 @@ async def lifespan(app: FastAPI):
93
allow_origins=[
94
str(origin).strip("/") for origin in settings.BACKEND_CORS_ORIGINS
95
],
96
+ allow_origin_regex=settings.BACKEND_CORS_ORIGIN_REGEXP,
97
allow_credentials=True,
98
allow_methods=["*"],
99
allow_headers=["*"],
0 commit comments