[url] Parsing an empty host (#79)

If I’m reading the parsing algorithm correctly, parsing `some-non-special-scheme:///` causes the host parser to be called with an empty string. Since *domain to ASCII* sets *VerifyDnsLength* to false, *asciiDomain* is also empty (not failure) and IPv4 parsing is called with an empty string. There, *parts* is first a list of one empty string, then an empty list:

> Let parts be input split on ".".
> If the last item in parts is the empty string, set syntaxViolationFlag and remove the last item from parts.

Later, *numbers* stays empty and some of the steps are nonsensical when they talk about the last item of *numbers*.

So:

* The IPv4 parser should probably return failure for the empty string as a first step
* This would make the host of this example URL an empty domain. Should it be null instead?

---
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/url/issues/79

Received on Thursday, 21 January 2016 18:28:16 UTC