[whatwg/url] Clarify status of empty path segments (#358)

4.5.6 says "Otherwise, then for each string in url’s path, append U+002F (/) followed by the string to output.", referencing 4.1 which gives "A URL’s path is a list of zero or more ASCII strings **holding data**, usually identifying a location in hierarchical form. It is initially empty." (emphasis mine). An empty (zero length) path segment does not hold data… but then 4.3 mentions that a path segment can have "zero or more URL units".

Is 4.3 (URL writing) meant to be prescriptive over 4.5 (URL serialization)? That is, should the URL `https://example.com/foo//bar` be considered equivalent to or distinct from `https://example.com/foo/bar`?

The spec seems to be laid out in a way that makes this confusing, and I see that the earlier language in 4.5.6 about empty path segments [was deleted](https://github.com/whatwg/url/pull/213/files#diff-03b21320f26423640f89c447968191e5L2144). On the other hand, I found [this test case](https://github.com/w3c/web-platform-tests/blob/4ea8eae2fd807ffd22e84f3c2f2ca12f798f8206/url/urltestdata.json#L2100-L2114) that suggests empty path segments should be allowed in a normalized URL.

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

Received on Thursday, 7 December 2017 19:50:15 UTC