Repository navigation
fix(browser): preserve URL paths when removing credentials - #4731
Conversation
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. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
[Medium impact] The PR appears safe to merge; no actionable issue was found. SummaryThe PR replaces duplicate credential parsing with the shared parser, preserving original path, query, and fragment bytes when removing userinfo.
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Original URL] --> B[Parse URL]
B --> C{Has credentials?}
C -->|No| D[Keep original bytes]
C -->|Yes| E[Read shared credential span]
E --> F{Span is clear?}
F -->|Yes| G[Remove only credential bytes]
F -->|No| H[Return parsed URL without credentials]
Reviews (3) · Last reviewed commit: "chore: integrate upstream CI compatibili..." · Reviewed by Greptile |
|
Thanks @ShuaixinHuang for catching the URL case where a backslash and |
Problem and outcome
Removing userinfo from
https://user:[email protected]\path@tail/../keep?x=1#fragchanged its host totail, while the reported origin still namedallowed.example. The duplicate authority parser mistook a path@after a special-scheme backslash for userinfo.Reuse the shared transport parser's credential spans and remove only those original bytes. Ambiguous spellings keep the existing credential-free parsed fallback. Relative/unparseable URL behavior is unchanged; this complements #2878's proposed relative-reference handling. The superseded authority parser is removed.
Validation
Head
c942f642a937fc539f08a4fe5fae445c5a81d1e7, normally merged upstream78cf6100; Windows x64, pinned Node 24.18.0/npm 11.16.0.npm run check6/6 plus architecture guards passed;git diff --checkpassed. The upstream formatting-onlycall(...)correction unblocks the shared static gate without changing assertions. Original test discovery: 1,498 files exactly once; this follow-up adds verifier scripts, not Vitest files.npm run verify:browserwith an isolated owned headless profile, covering public CLI/stdio MCP observation and bundle analysis, screenshots, network, script export, module tracing and scenario workflows. After the final load barrier was added, its exact helper was verified again in a fresh real Edge process. The browser production/verifier files are byte-identical to thisf888dee8validation stage after the final upstream merge.Debugger.scriptParsedretains both raw credential-bearing and credential-freesourceURLlabels. Public CLI and stdio MCP preserve the original path/query/fragment while removing userinfo, and independently verify selected source bytes and SHA-256. Independent reviews found no actionable issue.An earlier expanded Windows selection reported 16 passed / 1 failed: the unchanged browser-startup SIGTERM fixture expected Unix signal termination, but Windows reported exit code 1 without a signal. That failure remains recorded; no assertion or production behavior was weakened to hide it. Windows process-family lineage proof also remains unavailable in the verifier report; resource-close completion is not claimed as whole-family proof.
Browser navigation normalizes backslashes and dot segments; the new regression explicitly exercises real V8 script labels. It does not claim raw navigation/HTTP URL preservation. Existing 1,101-target capacity and attachment assertions remain intact.
The current PR real Chrome job passed on Chrome/155.0.8059.39 with
verified: true. The newurlUserInforeport confirms CLI, stdio MCP, raw V8 spelling, the credential-free control and original-source digest checks all passed. Its Linux point-in-time lineage check succeeded; this does not replace the unavailable Windows lineage proof. The current-head required CI passed. Earlier static-gate failures and their skipped Chrome jobs are not reported as executed provider evidence. Prepared with AI assistance.Author readiness
Human owner: @ShuaixinHuang