Skip to content

Commit 77992a5

Browse files
authored
🐛 Fix parse_cors function to be consistent for both empty string and empty list (#1672)
1 parent 984cc58 commit 77992a5

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
@@ -17,7 +17,7 @@
1717

1818
def parse_cors(v: Any) -> list[str] | str:
1919
if isinstance(v, str) and not v.startswith("["):
20-
return [i.strip() for i in v.split(",")]
20+
return [i.strip() for i in v.split(",") if i.strip()]
2121
elif isinstance(v, list | str):
2222
return v
2323
raise ValueError(v)

0 commit comments

Comments
 (0)