Repository navigation
fix(dev): preserve browser Host for API WebSockets - #844
Merged
Merged
Conversation
This was referenced Nov 12, 2026
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.
Cookie-authenticated Browser preview streams fail with
401in single-origin development when accessed through a forwarded frontend authority./apienabled WebSocket proxying but rewroteHostto the backend, leaving the browserOriginunchanged. Production cookie authentication correctly rejected that mismatch.Add
/apito the existing shared Host-preserving proxy policy. This accepted shared edit is one set entry and its explanatory comment; extracting another policy would duplicate the existing Vite integration. Backend origin checks and authentication remain unchanged. Jones-owned tests and additive boundary records contain the regression coverage.Validation:
EnvironmentAuth, using synthetic browser cookies, in-memory persistence, and the four scopes from the reported live baseline. No owner credentials or live application state are used.ac16cfd32a4cb298885a723865eb2c43f58116a6: preview receivesHost: 127.0.0.1:<backend-port>,Origin: http://127.0.0.1:26633, and returns401. With only the candidate policy restored, it passes with the original Host and101. The same test bytes are used for both runs./ws, media tickets, and refusal of missing/invalid credentials, foreign origins, and another port on the same host. Existing auth, preview-stream and device-hub suites pass all 51 tests; the new regression also passes.Base is current canonical main
ac16cfd32a4cb298885a723865eb2c43f58116a6; delivered cohort424cc87775332fc7d228de49fad68676257f8491remains an ancestor. The server fallback prefix list, Vite configuration, wire protocol, provider adapters, direct/relay/native connection paths and installed runtime are unchanged. This is source/proxy-auth verification, not final live Browser proof; the root owns live verification, independent review, CI and guarded merge. No watch or merge is requested from this child.Implemented by Codex (
gpt-6.1-sol, high reasoning) through the Codex harness in Jones Code.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.