diff --git a/url.bs b/url.bs index 127743cc..442dbe4e 100644 --- a/url.bs +++ b/url.bs @@ -655,17 +655,45 @@ runs these steps:
  • If asciiDomain contains a forbidden host code point, validation error, return failure. -

  • Let ipv4Host be the result of IPv4 parsing - asciiDomain. - -

  • If ipv4Host is an IPv4 address or failure, return - ipv4Host. +

  • If asciiDomain ends in a number, then return + the result of IPv4 parsing asciiDomain.

  • Return asciiDomain.


    +

    The ends in a number checker takes a string input and then runs these +steps: + +

      +
    1. Let parts be the result of strictly splitting input on + U+002E (.). + +

    2. +

      If the last item in parts is the empty string, then: + +

        +
      1. If parts's size is 1, then return false. + +

      2. Remove the last item from parts. +

      + +
    3. Let last be the last item in parts. + +

    4. If parsing last as an IPv4 number does not + return failure, then return true. + +

    5. +

      If last is non-empty and contains only ASCII digits, then return true. + +

      This can happen if last starts with "0" so the + IPv4 number parser tries to parse it as octal, but it is not a + valid octal number, as is the case with, for example, "09". + +

    6. Return false. +

    +

    The IPv4 parser takes a string input and then runs these steps: @@ -692,7 +720,8 @@ these steps: but if it somehow is this conditional makes sure we can keep going. --> -

  • If parts's size is greater than 4, then return input. +

  • If parts's size is greater than 4, validation error, + return failure.

  • Let numbers be an empty list. @@ -700,16 +729,10 @@ these steps:

    For each part of parts:

      -
    1. -

      If part is the empty string, then return input. - -

      0..0x300 is a - domain, not an IPv4 address. -

    2. Let result be the result of parsing part. -

    3. If result is failure, then return input. +

    4. If result is failure, validation error, return failure.

    5. If result[1] is true, then set validationError to true. @@ -754,6 +777,8 @@ these steps:

      The IPv4 number parser takes a string input and then runs these steps:

        +
      1. If input is the empty string, then return failure. +

      2. Let validationError be false.

      3. Let R be 10.