forked from 0xWheatyz/SPARC
Make CORS allowed origins configurable via environment variable #1444
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
Problem
api.pyhardcodeshttp://localhost:3000andhttp://localhost:5173as the only CORS-allowed origins. Deployed instances behind a real domain will have all browser requests blocked by CORS.What to do
CORS_ALLOWED_ORIGINSenvironment variable toconfig.py(comma-separated list of origins, defaulting to the two localhost values).CORSMiddleware..env.example.Acceptance criteria
CORS_ALLOWED_ORIGINS=https://sparc.example.comcauses the header to appear for that origin..env.examplewith a comment.Closing as duplicate of #1445.