[whatwg/url] URL dumb behavior (#623)

Could you please explain to me why are there special schemas for whatwg URL and why we cannot change from one protocol to another without a silent error?

Example
```
const url = new URL('es://localhost:9200')
url.protocol = 'http'
// outputs es://localhost:9200
```

Workaround
```
const url = new URL('es://localhost:9200')
url.protocol = 'httpx'
url.toString().replace(/httpx/, 'http')
// outputs http://localhost:9200
```

Why? I am really annoyed.

-- 
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/623

Received on Monday, 19 July 2021 17:37:57 UTC