Skip to content

fix: honor empty URL query and fragment markers - #2091

Merged
baron merged 1 commit into
morluto:mainfrom
fisforfaheem:fix/empty-url-query-fragment
Oct 12, 2026
Merged

baron merged 1 commit into
morluto:mainfrom
fisforfaheem:fix/empty-url-query-fragment

Conversation

@fisforfaheem

Copy link
Copy Markdown
Contributor

Summary

  • URL.search and URL.hash are empty both when a query or fragment is absent and when it is explicitly empty, so checks that used those fields accepted URLs such as http://127.0.0.1:9222/? and http://127.0.0.1:8425/mcp#.
  • Share one spelling check, 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.ts
  • oxlint, oxfmt --check, and scripts/verify-module-boundaries.mjs on the touched files
  • Confirm a CDP or V8 inspector report whose websocket URL ends in ? or # is rejected as an invalid endpoint

Made with Cursor

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]>
Copilot AI balanced review requested due to automatic review settings October 12, 2026 07:40

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-12T07:45:01.683270Z eda5e35 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@baron baron left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@baron
baron merged commit af29247 into morluto:main Oct 12, 2026
31 checks passed
@morluto morluto mentioned this pull request Oct 13, 2026
3 tasks done
@morluto morluto added the bug Something isn't working label Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants