fix(daemon): allow Browser Bridge ping probe via targeted CORS#1150
Merged
fix(daemon): allow Browser Bridge ping probe via targeted CORS#1150
Conversation
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.
Summary
GET /ping/pingvs/commandCORS behaviorWhy
Issue #1147 reports that the extension's pre-WebSocket
fetch(http://localhost:19825/ping)probe is blocked by CORS. That diagnosis is correct on current main:extension/src/background.tsprobes/pingbefore opening WebSocketsrc/daemon.tsintentionally returns no ACAO headersChange
This PR keeps the current design, but narrows one exception:
GET /pingreflectsAccess-Control-Allow-Originforchrome-extension://*originsReview context
@First-principles-0and@codex-mini0in the issue thread/commandstill gets no CORS headers even from extension originValidation
I added
src/daemon.test.tsfor:/ping+ extension origin => ACAO present/ping+ web origin => no ACAO/command+ extension origin => no ACAOLocal env note: this workspace currently lacks
vitestandtsc, so I could not run the existing test/typecheck commands here.