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

Spec update: IPv4 in IPv6 cleanup #83

Merged
merged 2 commits into from
Apr 14, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ whatwg-url is a full implementation of the WHATWG [URL Standard](https://url.spe

## Current Status

whatwg-url is currently up to date with the URL spec up to commit [703fcd](https://github.com/whatwg/url/commit/703fcd0b92053345582a36b2e4a642ab65df076e).
whatwg-url is currently up to date with the URL spec up to commit [488c45](https://github.com/whatwg/url/commit/488c459d9e4245a3f6bf087e7dcd2c7e91487ac5).

## API

Expand Down
8 changes: 4 additions & 4 deletions src/url-state-machine.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,10 +305,10 @@ function parseIPv6(input) {
} else {
ipv4Piece = ipv4Piece * 10 + number;
}
++pointer;
if (ipv4Piece > 255) {
return failure;
}
++pointer;
}

ip[piecePtr] = ip[piecePtr] * 0x100 + ipv4Piece;
Expand All @@ -318,10 +318,10 @@ function parseIPv6(input) {
if (numbersSeen === 2 || numbersSeen === 4) {
++piecePtr;
}
}

if (input[pointer] === undefined && numbersSeen !== 4) {
return failure;
}
if (numbersSeen !== 4) {
return failure;
}

break;
Expand Down