Skip to content

Fix CORS configuration#49

Merged
DanTcheche merged 1 commit into
mainfrom
fix/cors-setup
Mar 21, 2026
Merged

Fix CORS configuration#49
DanTcheche merged 1 commit into
mainfrom
fix/cors-setup

Conversation

@stefanotroncaro

Copy link
Copy Markdown
Contributor

Problem

The BACKEND_CORS_ORIGINS env in config.py is typed as Union[str, List[str]]. Pydantic never parses this env as a list because it attempts to cast unions in order, and str always succeeds.

Solution

Reverse the type annotation, to Union[List[str], str] so it tries to cast to a list first.

Also, correctly write the example in .env.example so that it's clear how to add many domains to the allowed list.

@stefanotroncaro stefanotroncaro marked this pull request as ready for review February 20, 2026 17:53
@DanTcheche DanTcheche merged commit c913af6 into main Mar 21, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants