- From: Aleš Menzel <notifications@github.com>
- Date: Mon, 19 Jul 2021 10:37:44 -0700
- To: whatwg/url <url@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Monday, 19 July 2021 17:37:57 UTC
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