forked from 0xWheatyz/SPARC
Make CORS allowed origins configurable via environment variable #93
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 the only allowed CORS origins. This makes the dashboard non-functional when deployed behind any real domain.Work
CORS_ORIGINSenvironment variable (comma-separated list of allowed origins) inconfig.py.api.pywith the configured value.http://localhost:3000,http://localhost:5173so local dev still works without configuration.CORS_ORIGINSin the README /.env.example.Acceptance Criteria
CORS_ORIGINS=https://sparc.example.comallows requests from that origin.CORS_ORIGINS=*allows all origins (useful for dev).api.py.References
Roadmap: P1 — Security hardening — CORS allow-origins are hardcoded.