forked from 0xWheatyz/SPARC
Make CORS allowed origins configurable via environment variable #68
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
api.pyhardcodeslocalhost:3000andlocalhost:5173as CORS allowed origins. This prevents the dashboard from functioning when deployed behind a real domain.Work
CORS_ALLOWED_ORIGINSenvironment variable (comma-separated list of origins).api.pyto read from this variable and fall back to the current localhost defaults if unset..env.exampleto document the new variable.Acceptance Criteria
CORS_ALLOWED_ORIGINS=https://sparc.example.comcauses the API to include that origin in CORS headers.localhost:3000,localhost:5173.References
Roadmap: Security hardening — configurable CORS allow-origins.
Resolved. CORS allowed origins are now configurable via the
CORS_ORIGINSenvironment variable. Implemented in PR #27 (merged). SeeSPARC/config.pyandSPARC/api.py.