Re: [whatwg/url] Redo validation errors in the IPv4 parser (PR #739)

@annevk commented on this pull request.



>  
-<ol>
- <li>
-  <p>Let <var>validationError</var> be false.
-
-  <p class=note>This uses <var>validationError</var> to track <a>validation errors</a> to avoid
-  reporting them before we are confident we want to parse <var>input</var> as an IPv4 address as the
-  <a>host parser</a> almost always invokes the <a>IPv4 parser</a>.
+<p class=note>The <a for=/>IPv4 parser</a> is not to be invoked directly. Instead check that the
+return value of the <a for=/>host parser</a> is an <a for=/>IPv4 address</a>.

The host parser does percent-decoding and ToASCII before determining if something is an IPv4 address. The only thing it does before IPv6 is removing square brackets. In practice though I think people should always use the host parser and therefore neither the IPv4 nor the IPv6 parser are exported.

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

Message ID: <whatwg/url/pull/739/review/1261864793@github.com>

Received on Thursday, 19 January 2023 14:06:13 UTC