Skip to content

Commit

Permalink
Spec update: IPv4 in IPv6 cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
watilde committed Apr 12, 2017
1 parent 6e0f00c commit 9339ab6
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/url-state-machine.js
Original file line number Diff line number Diff line change
Expand Up @@ -323,10 +323,10 @@ function parseIPv6(input) {
} else {
value = value * 10 + number;
}
++pointer;
if (value > 255) {
return failure;
}
++pointer;
}

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

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

Expand Down

0 comments on commit 9339ab6

Please sign in to comment.