Skip to content

Conversation

rolkotaki
Copy link
Contributor

Fix the parse_cors function in config.py so that it behaves consistently for both empty string and empty list.
Currently, when an empty list is provided as an argument, it returns an empty list ([]). However, when an empty string ("") is provided, it returns a list with an empty string ([""]) and starting the FastAPI application fails.

@rolkotaki
Copy link
Contributor Author

Anyone who is a maintainer, could you please add a label to this PR? Thanks.

@alejsdev alejsdev added the bug Something isn't working label Jul 5, 2025
@alejsdev alejsdev changed the title Fix parse_cors function to be consistent for both empty string and empty list 🐛 Fix parse_cors function to be consistent for both empty string and empty list Jul 5, 2025
@rolkotaki rolkotaki force-pushed the bugfix/parse-cors-function branch from 849cf1f to e90d3a2 Compare September 4, 2025 19:16
@YuriiMotov YuriiMotov changed the title 🐛 Fix parse_cors function to be consistent for both empty string and empty list 🐛 Fix parse_cors function to be consistent for both empty string and empty list Sep 4, 2025
Copy link
Contributor

@YuriiMotov YuriiMotov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Thanks!

Copy link
Member

@tiangolo tiangolo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, thanks! 🚀

@tiangolo tiangolo merged commit 77992a5 into fastapi:master Sep 20, 2025
15 checks passed
jpizquierdo pushed a commit to jpizquierdo/full-stack-fastapi-template that referenced this pull request Sep 24, 2025
@rolkotaki rolkotaki deleted the bugfix/parse-cors-function branch September 25, 2025 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants