fix(backend): restrict CORS to configured origins - #619
Open
woahwhattheheck wants to merge 5 commits into
Open
woahwhattheheck wants to merge 5 commits into
woahwhattheheck wants to merge 5 commits into
Conversation
This was referenced Sep 24, 2026
CORS does not cover direct WebSocket connections. Apply the existing exact origin allowlist through allowRequest while preserving intended clients without Origin and the existing credentialed preflight behavior. Add actual Socket.IO client regressions for WebSocket and polling origins. The two unlisted-origin cases fail before this change; all nine cases pass after it. Focused strict NodeNext TypeScript checking also passes.
Expose CORS_ORIGIN in backend setup, including exact matching, environment-specific defaults, HTTP preflight and the existing Socket.IO handshake policy. Preserve the implemented policy and prior runtime evidence.
Remove unsupported workflow-root retention settings, use explicit Bash for the Scaffold pipeline, and restore the executable manifest checker with guard/self path triggers. The before workflow and placeholder manifest blobs match the released repair exactly; these three resulting blobs and modes are identical to the already executed source at 0418d00. Reuse the retained checker/pipeline evidence without another test or application build. Evidence: https://tokenjunkielabs.slack.com/archives/C0BVANHNB26/p1791101295150569 Preserve all current CORS implementation and setup documentation on the original contribution branch.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #548
Configures
corsfromCORS_ORIGIN(comma-separated), enables credentials, handles preflight, and allows common localhost origins in development.