🐛 Fix parse_cors function to be consistent for both empty string and empty list (#1672)
This commit is contained in:
@@ -17,7 +17,7 @@ from typing_extensions import Self
|
||||
|
||||
def parse_cors(v: Any) -> list[str] | str:
|
||||
if isinstance(v, str) and not v.startswith("["):
|
||||
return [i.strip() for i in v.split(",")]
|
||||
return [i.strip() for i in v.split(",") if i.strip()]
|
||||
elif isinstance(v, list | str):
|
||||
return v
|
||||
raise ValueError(v)
|
||||
|
||||
Reference in New Issue
Block a user