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

Where is it defined that a URL must contain a scheme and a host in order to be a valid URL?

Even if such a definition exists, `new URL()` is the first API in the web ecosystem that I have encountered that has this limitation, making it quite surprising.

Beyond that, the WHATWG URL spec itself defines relative URLs...

https://url.spec.whatwg.org/#relative-url-string

As for existing implementations, see Node's `url.parse()` and `url.resolve()`, among others. I've used these extensively to manipulate URLs where the scheme and/or host is not known ahead of time and will be determined later by the end-user or browser, depending on where the URL is ultimately used.

-- 
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/531#issuecomment-659986998

Received on Friday, 17 July 2020 09:18:45 UTC