Repository navigation
fix(cli): normalize bare bracketed IPv6 addresses - #3583
Open
raunakpandey1 wants to merge 1 commit into
Open
raunakpandey1 wants to merge 1 commit into
raunakpandey1 wants to merge 1 commit into
Conversation
🦋 Changeset detectedLatest commit: 01d1f65 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
|
This PR is from an external contributor and must be approved by a stagehand team member with write access before CI can run. |
This branch has not been deployed
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.
why
Fixes #3582. Developers using
browse openwith bare IPv6 loopback addresses get a Chrome navigation error, although explicitly addinghttp://reaches the same local server.what changed
Recognize valid bracketed IPv6 addresses during URL normalization. Apply the existing scheme policy to them: HTTP for loopback, HTTPS for other hosts. Preserve the supplied address, port, path, query, and fragment. Explicitly schemed URLs and invalid bracketed inputs pass through unchanged.
test plan
pnpm --filter browse test:cli tests/normalize-url.test.ts: three new regression cases failed on main. All 22 cases pass with the fix.pnpm --filter browse build. Usedbrowse open --localwith Chrome against a Node HTTP server bound to::1, following the issue's reproduction. On main, the explicit URL opened the fixture and the bare address exited 1 with-32000 Cannot navigate to invalid URL. With this patch, both forms exited 0 and returned the fixture's title andhttp://[::1]:<port>/URL.git diff --checkpassed.Summary by cubic
Fixes #3582:
browse opennow normalizes bare bracketed IPv6 addresses like[::1]:3000so Chrome can open them without an explicit scheme. Previously these failed withCannot navigate to invalid URL.http://for[::1]loopback,https://for other IPv6 hosts.Written for commit 01d1f65. Summary will update on new commits.