Hi, I'm back with more questions on the URL spec after poking at it a bit more for various purposes.

One thing I've noticed is that the specification currently aggressively fails IPv6 address matching, so, e.g., new URL("http://[::1::]";) would fail. (Although it allows http://[1:2:3:4:5:6::8]/ to go through whereas RFC 5952 advises that ":: MUST NOT be used to shorten just one 16-bit 0 field.") However, it doesn't apply this same logic to IPv4: new URL("http://192/";) is parsed as a perfectly valid URL. Is this intentional?

--
Joshua Cranmer
Source code arch├Žologist


--
Beware of bugs in the above code; I have only proved it correct, not tried it. -- Donald E. Knuth

Reply via email to