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 13, 2017
1 parent 9fc1925 commit 6740b29
Showing 1 changed file with 4 additions and 4 deletions.
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 6740b29

Please sign in to comment.