forked from 0xWheatyz/SPARC
Make CORS allowed origins configurable via environment variable #40
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?
Problem
api.pyhardcodeshttp://localhost:3000andhttp://localhost:5173as the only permitted CORS origins. When the dashboard is deployed behind a real domain, all cross-origin requests are rejected.Task
CORS_ALLOWED_ORIGINSenvironment variable (comma-separated list of origins).api.pyat startup and pass the parsed list toCORSMiddleware.http://localhost:3000,http://localhost:5173when the variable is unset so local development is unaffected..env.examplewith a comment explaining the format.Acceptance Criteria
CORS_ALLOWED_ORIGINS=https://app.example.comallows requests from that origin.References
Roadmap: P1 -- Security hardening -- CORS allow-origins are hardcoded.
Closing: Already implemented in PR #27. CORS origins are now configurable via config.cors_origins.