Re: [whatwg/url] Allow protocol setter to switch between special and non-special schemes (Issue #674)

The alternative for switching to `http` for URLs with an empty or absent host, without serialising and reparsing the URL is to remove all empty path segments and the first non-empty path segment, then parse that non-empty segment as an authority and adjust the username/password/host/port properties accordingly (or fail otherwise).

You’d have to adjust for the scheme dependent percent coding though. 

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/url/issues/674#issuecomment-1021639116

You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/url/issues/674/1021639116@github.com>

Received on Tuesday, 25 January 2022 21:46:27 UTC