Skip to content

Commit 7cc1082

Browse files
committed
Fix the parse_cors function to be consistent for both empty string and empty list
1 parent e4387f4 commit 7cc1082

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

backend/app/core/config.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818

1919
def parse_cors(v: Any) -> list[str] | str:
2020
if isinstance(v, str) and not v.startswith("["):
21+
if not v.strip():
22+
return []
2123
return [i.strip() for i in v.split(",")]
2224
elif isinstance(v, list | str):
2325
return v

0 commit comments

Comments
 (0)