Repository navigation
fix: honor empty URL query and fragment markers - #2091
Conversation
URL.search and URL.hash are empty for both a missing component and an explicit empty one, so endpoint and origin checks were accepting URLs the callers meant to reject. Co-authored-by: Cursor <[email protected]>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
baron
left a comment
There was a problem hiding this comment.
Reviewed exact head eda5e35 and current-main integration. No source/design blocker.
A shared URL-component presence owner replaces fallible search/hash emptiness checks across existing consumers, distinguishes encoded delimiters from real empty components, and preserves original captured URL spelling. No obsolete touched interpretation or useful distinct malformed/collision test was discarded. Pinned validation: 23 relevant helper/contract/JEB/export tests and check:fast passed. No real provider compatibility claim; exact-head hosted CI is green and integration is clean.
Summary
URL.searchandURL.hashare empty both when a query or fragment is absent and when it is explicitly empty, so checks that used those fields accepted URLs such ashttp://127.0.0.1:9222/?andhttp://127.0.0.1:8425/mcp#.urlDeclaresQueryOrFragment, and use it for browser origins and CDP endpoints, CDP and V8 inspector sockets, JEB MCP endpoints, runtime URL prefixes, and captured script export paths (the case fixed in fix(browser): isolate script URLs with empty query or fragment #2074).Test plan
npm run test:focused -- src/domain/urlComponents.test.ts src/domain/browserObservation.test.ts src/domain/webScriptExportPlan.test.ts src/jeb/JebMcpEndpoint.test.tsoxlint,oxfmt --check, andscripts/verify-module-boundaries.mjson the touched files?or#is rejected as an invalid endpointMade with Cursor