forked from 0xWheatyz/SPARC
Make CORS allowed origins configurable via environment variable #1069
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
Roadmap reference: P1 / Security hardening
api.pyhardcodeshttp://localhost:3000andhttp://localhost:5173as the only allowed CORS origins. This breaks the dashboard when deployed to any real domain.What to do
CORS_ALLOWED_ORIGINSenvironment variable (comma-separated list of origins).api.pyto read this variable at startup and pass it to the CORS middleware..env.examplewith the new variable.Acceptance criteria
CORS_ALLOWED_ORIGINS=https://sparc.example.comcauses that origin to be accepted.api.py.Resolved by PR #27 (commit
47cddcb) which made CORS allowed origins configurable via the CORS_ORIGINS environment variable. Closing as complete.