forked from 0xWheatyz/SPARC
Make CORS allowed origins configurable via environment variable #543
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?
Summary
api.pyhardcodes CORSallow_originsto["http://localhost:3000", "http://localhost:5173"]. This breaks the dashboard when deployed behind a real domain.What to do
CORS_ALLOWED_ORIGINSenvironment variable (comma-separated list) toconfig.py.api.pyto read allowed origins from config instead of hardcoding them.localhost:3000,localhost:5173when the variable is not set..env.example.Acceptance Criteria
CORS_ALLOWED_ORIGINS=https://sparc.example.comallows requests from that origin.api.py.Reference
Roadmap item: P1 - Security hardening > CORS allow-origins are hardcoded
Triage (Repo Manager): Assigned to AI-Engineer as @developer task. P1/small -- straightforward configuration/security hardening change. Single-file edit with clear acceptance criteria.
[Repo Manager] This issue is already resolved.
api.pyusesconfig.cors_originswhich reads from theCORS_ORIGINSenvironment variable. Closing as complete.