Re: [whatwg/url] IPv4 host parser + site definition seems potentially dangerous. (#560)

> and then we invoke the IPv4 number parser 4 times on empty strings

Why? The first step of the _parts_ loop does:

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

(I did misunderstand though as you were talking about a different empty string, i.e., one resulting from splitting a sequence of dots.)

---

> I'm not seeing why this is?

Yeah, I clearly misread that. Sorry about that. I guess the one change needed to your set of steps is that we also want to return input if the last part (at that point, i.e., after removing an initial last part empty string, if any) is the empty string.

And we could also consider moving that into the host parser as being the decider between IPv4 and domain names. (Though I'm not sure how to restructure it nicely yet.)

-- 
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/issues/560#issuecomment-737075081

Received on Wednesday, 2 December 2020 08:29:11 UTC