Skip to content

Commit 849cf1f

Browse files
committed
Update parse_cors function to work for edge case when nothing is provided after or between commas
1 parent ead5fa8 commit 849cf1f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

backend/app/core/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def parse_cors(v: Any) -> list[str] | str:
2020
if isinstance(v, str) and not v.startswith("["):
2121
if not v.strip():
2222
return []
23-
return [i.strip() for i in v.split(",")]
23+
return [i.strip() for i in v.split(",") if i.strip()]
2424
elif isinstance(v, list | str):
2525
return v
2626
raise ValueError(v)

0 commit comments

Comments
 (0)