forked from 0xWheatyz/SPARC
Make CORS allowed origins configurable via environment variable #941
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?
Background
api.pyhardcodeslocalhost:3000andlocalhost:5173as allowed origins. This means the dashboard will fail CORS checks when deployed behind any real domain.Task
CORS_ALLOWED_ORIGINSenvironment variable (comma-separated list of origins).api.py(orconfig.py) and pass it to the CORS middleware..env.exampleorREADME.Acceptance Criteria
CORS_ALLOWED_ORIGINS=https://sparc.example.comcauses that origin to be permitted.Reference
Roadmap: P1 Security hardening — CORS allow-origins are hardcoded.
Triaged by repo manager. This issue has already been resolved in the current codebase.
config.py(lines 63-70) readsCORS_ORIGINSas a comma-separated env var and falls back to localhost defaults.api.pypassesconfig.cors_originstoCORSMiddleware. The variable is documented in.env.example(line 36). Closing as already implemented.