Enumerate differences with URI & IRI in an appendix - #923
Conversation
This focuses on the differences people seem most concerned about, namely parsing and model differences. There's also equivalence, canonicalization, reference resolution as a standalone concept, and validity. Some of that is hinted at here.
|
| <li><p>RFC 6874 IPv6 zone identifiers are not recognized. | ||
| <code>http://[fe80::a%25eth0]/</code> fails. |
There was a problem hiding this comment.
It is worth adding a note to the introduction that mentions that this also includes analysis of other RFCs, like this?
I'm also thinking that RFC 8089 might be worth a mention, given that there is special treatment. And I guess, since this is such a large component of the logic here, Section 4.2 of RFC 9110.
domenic
left a comment
There was a problem hiding this comment.
This would probably also benefit from some review from RFC partisans.
I suggested one paragraph about expanding the model differences, but I still feel there's more to say. But, perhaps your intent is to focus more on concrete mismatches and deemphasize that aspect.
| </ul> | ||
|
|
||
|
|
||
| <h3 id=uri-iri-differences-model class=no-num>Different model</h3> |
There was a problem hiding this comment.
I would lead with this section and make it stronger / change the framing. Something like:
This standard is based around a parser and serializer, with a structured data type (the URL record) as the intermediary. RFC 3986 and RFC 3987 are based around ABNF grammars, which can be run against input strings to produce a boolean "matches / doesn't match" verdict. (In some cases, one can infer a decomposition of the input strings into substrings by looking at which sub-productions of the RFCs match which substrings of the input. But this is tricky to do consistently.)
Similarly, it may be worth mentioning how the URL Standard approaches normalization and relative URL resolution as something done during parsing, instead of having separate Reference Resolution and Normalization and Comparison steps (especially the complex multi-step comparison ladder). Although that touches on #729 and related issues.
| By contrast, <code>file:///path</code> parses as expected (empty host, path | ||
| "<code>/path</code>"). | ||
|
|
||
| <li><p>Domain hosts of special URLs go through UTS #46 ToASCII, which converts Unicode labels |
There was a problem hiding this comment.
This bullet is inaccurate ("Non-special hosts are preserved verbatim") and less informative than it could be. Maybe something like
Non-ASCII domain host treatment differs. Special URLs go through UTS #\46's ToASCII, which converts Unicode labels to Punycode and lowercases ASCII labels:
https://☕.EXAMPLE/→https://xn--53h.example/. Non-special URLs are percent-encoded:foo://☕.EXAMPLE/→foo://%E2%98%95.EXAMPLE/. This contrasts with 3986, which rejects non-ASCII hosts and only optionally lowercases them, or 3987, which suggests percent-encoding as a default with an older, buggier version to ToASCII from RFC 3490 as a fallback for an undefined set of schemes.
| than rejected, and a bare U+0025 (%) is preserved. | ||
| <code>https://example.org/foo bar</code> → <code>https://example.org/foo%20bar</code>; | ||
| <code>https://example.com/%</code> parses distinctly from <code>https://example.com/%25</code>. | ||
| </ul> |
There was a problem hiding this comment.
Notable missing cases probably worth including:
- Port normalization (especially default-port elision and restriction to < 2^16)
- Host percent-decoding, e.g. parsing of
https://exam%70le.org/andhttps://exa%23mple.org/. - IPv6 normalization (similar to what is already mentioned for IPv4)
- Userinfo format; in particular the URL Standard splits at first
:into username and password but the RFC deprecates theusername:passwordformat - Allowing
@in userinfo and percent-encoding it (i.e.https://a@b@example.com/) - URL code points are a superset of 3987, e.g.
U+FFF0is allowed by the URL Standard - Scheme lowercasing
|
|
||
| <ul> | ||
| <li><p>Non-ASCII input is percent-encoded rather than rejected. | ||
| <code>https://example.com/café</code> → <code>https://example.com/caf%C3%A9</code>. |
There was a problem hiding this comment.
This is confusing/wrong as written, since 3986 rejects them but 3987 accepts them as IRIS and then tells you how to convert them to URIs.
| <p>This appendix is non-normative. It highlights how this standard differs from RFC 3986 and | ||
| RFC 3987, and assumes familiarity with all three. [[RFC3986]] [[RFC3987]] | ||
|
|
||
| <p>Most of these differences also produce a <a>validation error</a>, though in practice those are |
There was a problem hiding this comment.
"Most" might be overclaiming, e.g. points 1, 4, 12, 15 do not, plus the ones source-commented already. "Some" or "many" seems better.
| <code>http://[v1.fe80]/</code> fails. | ||
|
|
||
| <li><p>RFC 6874 IPv6 zone identifiers are not recognized. | ||
| <code>http://[fe80::a%25eth0]/</code> fails. |
There was a problem hiding this comment.
3986 and 3987 also prohibit these, so this is a bit out of place.
| <code>http://[fe80::a%25eth0]/</code> fails. | ||
|
|
||
| <li><p>A <code>file:</code> URL with host "<code>localhost</code>" normalizes to an empty host. | ||
| <code>file://localhost/</code> → <code>file:///</code>. |
There was a problem hiding this comment.
3986 / 3987's optional scheme normalization also does this; might be worth mentioning similar to other cases.
| <li><p>Percent-encoded dot segments always collapse as "<code>.</code>"/"<code>..</code>". | ||
| <code>/a/%2E%2E/b</code> against <code>http://example.com/</code> → | ||
| <code>http://example.com/b</code>. RFC 3986 only reaches the same result with optional | ||
| percent-encoding normalization. |
There was a problem hiding this comment.
| percent-encoding normalization. | |
| percent-encoding normalization plus optional dot-segment normalization. |
|
|
||
| <p>Depending on the component, a bare U+0025 (%), U+0022 ("), U+005B ([), U+005C (\), U+005D (]), | ||
| U+005E (^), U+0060 (`), U+007B ({), U+007C (|), or U+007D (}) can survive parsing, and | ||
| U+0023 (#) can survive inside a fragment. Any URL that carries such a code point serializes to a |
There was a problem hiding this comment.
This sentence sounds exhaustive but isn't, e.g. it omits <, >, ", U+0020 in opaque paths.
|
Thanks for all the feedback! With the model section I wanted to focus on the representation differences. E.g., that a URL can have a path that is Many differences go away after parsing because There are indeed also other differences such as how we deal with relative URLs, normalization, and comparison, but those feel less important. |
This focuses on the differences people seem most concerned about, namely parsing and model differences.
There's also equivalence, canonicalization, reference resolution as a standalone concept, and validity. Some of that is hinted at here.
Preview | Diff