[whatwg/url] File URL reparse bug with percent encoded windows drive letter (#559)

There is a reparse bug, when parsing URL with percent encoded windows drive letter (`C|`) in the host. URLs to test:

`file://%43%7C`
`file://C%7C`
`file://%43|`

Any of them parses to `file://c|/`, the latter - to `file:///c:/`.

Let's see how browsers parse them:

Browser | first pass | second pass
-|-|-
Chrome: | `file://c%7C/` | `file://c%7C/`
Firefox: | `file:///` | `file:///`
Safari: | `file://c\|/` | `file:///c:/`

Safari has the same bug as spec. Chrome suggests possible resolution. 

Some ways how to fix bug:

1. Percent encode `|` in the host after host parsing (as Chrome does)
2. Fail if host contains `|` after host parsing.
3. Check for Windows drive letter after host parsing.


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

Received on Monday, 26 October 2020 16:08:21 UTC