Skip to content

Commit 99ba657

Browse files
committed
raise validation error
1 parent c630bf6 commit 99ba657

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

stac_fastapi/pgstac/config.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -201,9 +201,8 @@ class Settings(ApiSettings):
201201
@model_validator(mode="after")
202202
def check_origins(self) -> Self:
203203
if self.cors_origin_regex and "*" in self.cors_origins:
204-
warnings.warn(
205-
"Both `cors_origin_regex` and `*` found in `cors_origins`! `cors_origin_regex` will be ignored.",
206-
UserWarning,
207-
stacklevel=1,
204+
raise ValueError(
205+
"Conflicting options found in API settings: `cors_origin_regex` and `*` in `cors_origins`"
208206
)
207+
209208
return self

0 commit comments

Comments
 (0)