Re: [whatwg/url] Support relative URLs (#531)

I'm starting to think that would work best as a separate document. It would need a reference implementation and its own comprehensive test-suite; essentially being another URL standard. What's more is that I'm not sure how many implementations would actually want this. I'm not convinced the use-cases are entirely clear.

I've seen HTTP routing mentioned as a major use-case, but HTTP origin-form request targets (of the form: `/foo?bar`) are **not** relative URL references. They are combined path-and-queries, and the [HTTP standard says](https://httpwg.org/specs/rfc7230.html#effective.request.uri) that you should use string concatenation (not relative reference resolution) to reconstruct the effective request URL. If you don't want to use string concatenation, you could split the request target and use the existing `pathname` and `search` setters. In any case, relative URLs don't come in to HTTP routing whatsoever.

To put it another way, what do you think `GET //foo/bar?baz` should resolve to? As a relative reference, this would be a hostname of `foo` and path of `bar`. Following the HTTP standard, it would be a path of `//foo/bar`.

By the way, I'm not the only one to bring this up - it was also mentioned in [this comment](https://github.com/nodejs/node/issues/12682#issuecomment-399149181) on the NodeJS issue, and was positively received but ultimately appears to have been ignored.

There may be use-cases which require manipulating a relative reference in a scheme, host and base path-independent context, but I haven't seen the long list of convincing use-cases such a large change to the standard would require. Right now it seems to be based on a misconception, using Github reactions to put pressure on the standard.

We are nowhere near the proposal stage, IMO. Personally I'd be -1 if it was proposed today without multiple clear and convincing use-cases, backed up by experience using a reference implementation, and as mentioned, a very extensive suite of tests.

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

Message ID: <whatwg/url/issues/531/1032479374@github.com>

Received on Tuesday, 8 February 2022 10:59:58 UTC