Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: support parsing IPv6 addresses with zone indexes in browsers #10

Merged
merged 2 commits into from
Aug 11, 2023

Conversation

achingbrain
Copy link
Contributor

@achingbrain achingbrain commented Aug 10, 2023

IPv6 addresses like fe80::8cb1:25ff:fec5:28e3%llw0 are valid but contain a zone index. This is parsed correctly by the net module on node but not by the browser polyfill here.

The fix here is just to strip the % character and anything that follows it from the input string.

Adds a test for this, and also adds support for running the tests in Chrome in dev and CI.

Fixes #9

IPv6 addresses like `fe80::8cb1:25ff:fec5:28e3%llw0` are valid but
contain a zone index.  This is parsed correctly by the `net` module
on node but not by the browser polyfill here.

The fix here is just to strip the `%` character and anyything that
follows it from the input string.

Adds a test for this, and also adds support for running the tests
in Chrome in dev and CI.

Fixes ChainSafe#9
@achingbrain achingbrain requested a review from a team as a code owner August 10, 2023 11:36
@mpetrunic mpetrunic merged commit 9454b59 into ChainSafe:master Aug 11, 2023
@achingbrain achingbrain deleted the fix/zone-indexes-in-browsers branch August 11, 2023 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

IPv6 address with scope ID fails validation in browsers
2 participants