Re: [whatwg/url] Reject non-IPv4 hostnames that end in numbers. (#619)

@domenic approved this pull request.

Non-editor review based on implementing jsdom/whatwg-url: LGTM with nits.

> @@ -655,17 +655,44 @@ runs these steps:
  <li><p>If <var>asciiDomain</var> contains a <a>forbidden host code point</a>,
  <a>validation error</a>, return failure.
 
- <li><p>Let <var>ipv4Host</var> be the result of <a lt="IPv4 parser">IPv4 parsing</a>
- <var>asciiDomain</var>.
-
- <li><p>If <var>ipv4Host</var> is an <a>IPv4 address</a> or failure, return
- <var>ipv4Host</var>.
+ <li><p>If <var>asciiDomain</var> <a lt="ends in a number checker"> ends in a numer, return

```suggestion
 <li><p>If <var>asciiDomain</var> <a lt="ends in a number checker">ends in a number</a>, return
```

>  
  <li><p>Return <var>asciiDomain</var>.
 </ol>
 
 <hr>
 
+<p>The <dfn id=ends-in-a-number>ends in a number checker</dfn> takes a string <var>input</var> and
+then runs these steps:
+
+<ol>
+ <li><p>Let <var>parts</var> be the result of <a>strictly splitting</a> <var>input</var> on
+ U+002E (.).
+
+ <li>
+  <p>If the last <a for=list>item</a> in <var>parts</var> is the empty string, then:
+
+  <ol>
+   <li><p>If <var>parts</var>'s <a for=list>size</a> is 1, return false.
+
+   <li>Otherwise, <a for=list>remove</a> the last <a for=list>item</a> from <var>parts</var>.

```suggestion
   <li><p><a for=list>remove</a> the last <a for=list>item</a> from <var>parts</var>.
```

> @@ -754,7 +776,9 @@ these steps:
 <p>The <dfn>IPv4 number parser</dfn> takes a string <var>input</var> and then runs these steps:
 
 <ol>
- <li><p>Let <var>validationError</var> be false.
+ <li><p>If <var>input</var> is the empty string, then return failure.
+
+<li><p>Let <var>validationError</var> be false.

```suggestion
 <li><p>Let <var>validationError</var> be false.
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/url/pull/619#pullrequestreview-706759065

Received on Wednesday, 14 July 2021 22:10:28 UTC