diff --git a/src/url-state-machine.js b/src/url-state-machine.js index 047052f..a9494f7 100644 --- a/src/url-state-machine.js +++ b/src/url-state-machine.js @@ -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; @@ -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; } }