Re: [whatwg/url] Support IPv6 zone identifiers (#392)

I don't think the problem is with browsers specifically.

The issue is that the new RFC is defined in terms of RFC-3986 and updates it, but 3986 makes quite a broad promise of hosts being case-insensitive. It does not even restrict this to certain _kinds_ of hosts - it just says "the host subcomponent". So it's extremely broad, and there may be applications which rely on that.

For example, imagine I have some sort of application-level cache - I can treat requests to `SOMEHOST` as being equivalent to a request to `somehost`. Given the language in 3986, I don't even need to figure out what kind of host is being referred to (whether it's an IP address or registered name) - I can just lowercase everything, and that's fine. Maybe I won't catch all requests to the same IP address, but I won't produce false positives, where I say 2 different hosts are equivalent.

This new RFC would make an incompatible change to 3986, by taking away that promise and saying that _some_ hosts may actually be case-sensitive, and that if you just lowercase them as was previously allowed, you might be meaningfully altering which host is being referred to.

The WHATWG URL standard would actually be _more accommodating_ of case-sensitive elements within IP literals than RFC-3986, because we don't make the same broad guarantee. In the WHATWG model, the parser takes a string and creates a URL record from it, and that URL record can contain a host (which is also a record, containing the parsed IP address value). The URL serialiser produces the canonical textual form of that URL record, so nobody needs to do things like manually lowercasing hostnames, and nowhere in the standard does it recommend that anybody does so themselves; the output is already normalised to the extent the standard defines things to be equivalent:

```
Parsing any of:

http://[::ABCD]/
http://[::abcd]/
http://[::0:0:0:ABCD]/
http://[::0.0.171.205]/

All produce the same result:

http://[::abcd]/
```

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/url/issues/392#issuecomment-1299001065
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/url/issues/392/1299001065@github.com>

Received on Tuesday, 1 November 2022 19:21:36 UTC