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

Hi all,

In order to make some progress on this topic I would like to propose a compromise change to the URL standard that punts on all the hard questions about zone ID.

As indicated in [Martin's feedback](https://datatracker.ietf.org/doc/review-ietf-6man-rfc6874bis-02-artart-lc-thomson-2022-09-16/) most browsers still have a problem with the zoneID and wouldn't implement it. However, URLs with a zoneID still exist, and the fact that URL parsers consider them invalid isn't great.
The use case that I encountered was that my printer settings was pointing me towards a URL containing a zoneID - obviously that failed to parse, so I had to manually remove the zoneID from the URL to access it.
The middle ground I'm thinking of is the parser would remove (and ignore) the zoneID while parsing the URL so at least it works on machines that have a default zone ID.

The changes to the URL parsing algorithm would be minimal:
In https://url.spec.whatwg.org/#concept-ipv6-parser Step 6 would become: `While [c](https://url.spec.whatwg.org/#c) is not the [EOF code point](https://url.spec.whatwg.org/#eof-code-point) and [c](https://url.spec.whatwg.org/#c) is not U+0025 (%):`
and 6.7 would become `Otherwise, if [c](https://url.spec.whatwg.org/#c) is not the [EOF code point](https://url.spec.whatwg.org/#eof-code-point) and [c](https://url.spec.whatwg.org/#c) is not U+0025 (%), [validation error](https://url.spec.whatwg.org/#validation-error), return failure.`
This would have the effect of the zoneID being ignored, so at least we are able to parse such URLs.

@annevk if this is acceptable I will send a PR. Hopefully this is non-controversial enough to be acceptable to Blink and WebKit too.


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

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

Received on Thursday, 19 January 2023 10:07:54 UTC