3 ms·
Which doesn’t conform to RFC 3986, by the way. The syntax rule for host is ambiguous because it does not completely distinguish between an IPv4address an
by layer8 2y ago
Which doesn’t conform to RFC 3986, by the way.
The syntax rule for host is ambiguous because it does not completely
distinguish between an IPv4address and a reg-name. In order to
disambiguate the syntax, we apply the "first-match-wins" algorithm:
If host matches the rule for IPv4address, then it should be
considered an IPv4 address literal and not a reg-name.
This means that URL syntax like http://16843009/ http://16843009/, http://127.1/ http://127.1/, http://010.010.010.010/ http://010.010.010.010/, and http://127.0.0.1./ http://127.0.0.1./ (note the final dot) should be interpreted as domain names, not as IP addresses. (Domain labels are allowed to be purely numeric.)
- chrismorgan 2y agoBut it does comply with WHATWG’s URL Standard, which declares the goal of obsoleting RFC 3986, providing something that’s actually robustly implementable, and reflecting reality. Some things do definitely try to follow RFC 3986 still, but my feeling is that it’s mostly legacy stuff, and the URL Standard is much more important these days. Though RFCs dealing with URLs will probably still cite it (e.g. RFC 9110, HTTP Semantics, June 2022). https://url.spec.whatwg.org/#host-parsing https://url.spec.whatwg.org/#host-parsing, follow step seven.
- layer8 2y agoTrue, though the WHATWG algorithm still raises validation errors internally for all these cases. Meaning, while these representations are leniently accepted, they aren’t intended to be valid representations.