forked from 0xWheatyz/SPARC
Make CORS allowed origins configurable via environment variable #1351
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 item: P1 Security hardening
api.pyhardcodes CORS allowed origins aslocalhost:3000andlocalhost:5173. This breaks the dashboard when deployed behind a real domain.What to do
CORS_ALLOWED_ORIGINSenvironment variable inconfig.py(comma-separated list of origins).api.pyto read allowed origins from the config instead of hardcoding them..env.example(or equivalent).Acceptance criteria
CORS_ALLOWED_ORIGINS=https://sparc.example.comcauses the API to accept requests from that origin.api.py.[Repo Manager] This issue has already been resolved on the main branch. Verified by code inspection during triage. Closing.