Repository navigation
Conversation
inspect_web_network_capture validates request.url with ajv-formats' RFC 3986
`uri` format. Browsers serialize request URLs per WHATWG URL and leave
[ ] { } | ^ and backtick, a `%` that starts no escape, and a backslash in the
query or fragment unescaped, so a HAR that Chrome itself exports for such a
page was rejected whole as a format error.
- A request URL is admitted when the pinned RFC 3986 check accepts it as
written or with only those characters percent-encoded: each [ ] { } | ^ and
backtick, each `%` not followed by two hex digits, and each backslash after
the first `?` or `#`. Spellings that only WHATWG parsing accepts, such as a
backslash before the first `?` or `#` or a tab, stay rejected: browsers
never serialize them, and WHATWG alone reads an authority through them.
- The transport-credential header set moves unchanged from CaptureRedaction
to src/browser/network/TransportCredentials.ts; capture_browser_scenario's
network headers now use it instead of a private copy, and the session
HAR recorder in the next change applies the same set.
Co-Authored-By: Claude Opus 5.5 <[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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6b912ce5b9
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| value.replace( | ||
| /[[\]{}|^`\\]|%(?![0-9A-Fa-f]{2})/gu, |
There was a problem hiding this comment.
Require fallback URLs to be browser serializations
When a listed character appears in a component where browsers do not preserve it, this component-blind replacement converts malformed input into valid RFC syntax. For example, https://example.test/a{b} is neither RFC-valid nor its own WHATWG serialization (new URL(...).href contains %7B/%7D), but this code rewrites it for validation and admits the HAR. Limit the compatibility escaping to URL components where browsers actually retain these characters, or gate it with a format-aware serialization check.
AGENTS.md reference: AGENTS.md:L21-L21
Useful? React with 👍 / 👎.
Summary
inspect_web_network_capturevalidates each HARrequest.urlwith ajv-formats' strict RFC 3986uriformat. Browsers serialize request URLs per WHATWG URL and leave several characters unescaped:[ ] { } | ^and backtick, a%that starts no escape, and a backslash in the query or fragment. A HAR that Chrome itself exports for such a page is therefore rejected whole as a format error.Problem and expected behavior
On
main,decodeHarCapturerejects every one of these browser serializations withHAR schema validation failed: format.:https://example.test/?q=[1]|{x}/search?q=100%/x?cb=%%CACHEBUSTER%%/collect?e={%22k%22:%22a\%22b%22}They should decode. Spellings that browsers never produce stay rejected, for example
http:\\user:pass@host/and a tab inside the scheme.Change and scope
[ ] { } | ^and backtick;%not followed by two hex digits;?or#.?or#, and a tab, stay rejected.history/CaptureRedaction.tstosrc/browser/network/TransportCredentials.ts.capture_browser_scenario's network headers use it instead of a private copy, and the session HAR recorder (feat(browser): record observe_web_session traffic as HAR #2045) uses the same set. URL userinfo stays withsrc/domain/recordedTransportUrl.ts.Contract and boundary impact
src/browser/history/HarSchema.ts.docs/public/product-catalog.json), package, or installation impact: none.Evidence and regression coverage
tests/boundary/browser/historicalCaptureDecoder.test.tsruns the realdecodeHarCapture.http://example.com:99999/), every browser serialization above, a%followed by one hex digit and a non-hex character (?status=100%Done), and a fragment backslash. Each case also checks that the URL is its own WHATWG serialization and that the reported URL keeps its spelling.PlaywrightScenarioNetwork.test.tspins every member of the shared credential header set.mainevery admitted browser serialization above fails withformat.%rule.#.?.For evidence-bearing changes:
Validation performed
Host: macOS 27.0.1, Node 24.20.0.
turbo run typecheck lint format:check knip metadata:check docs:check:built mcp-catalog:check:built,npm run verify:architecture-guards,npm run verify:test-discoveryandnpx jscpd src/ tests/all pass.npx vitest runon 10 browser, CLI, MCP and process boundary files: 58 passed, 2 skipped.exposes CLI-equivalent Evidence results and session tools, an existing MCP test, times out only under heavy machine load. It fails the same way on unmodifiedmain.Compatibility, safety, and release
recordedTransportUrlstill excludes userinfo from every admitted URL.This PR stands on its own on
main. The session HAR PRs (#2045 onward) build on it.🤖 Generated with Claude Code