Skip to content

Commit

Permalink
Spec update: IPv4 in IPv6 cleanup
Browse files Browse the repository at this point in the history
This does not change behavior but keeps us up to date with the spec. Follows whatwg/url#292.
  • Loading branch information
watilde authored and domenic committed Apr 14, 2017
1 parent 9fc1925 commit 3ead227
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
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

0 comments on commit 3ead227

Please sign in to comment.