[whatwg/url] Fix: allow percent encoded code points in the non-special URLs host (#218)

After 30362553e9ce9fc706d3492bd61886e399fc94e2 introduced the [URL-host parser](https://url.spec.whatwg.org/commit-snapshots/30362553e9ce9fc706d3492bd61886e399fc94e2/#concept-url-host-parser) rejects percent encoded code points in the non-special URLs host (because "%" is [forbidden host code point](https://url.spec.whatwg.org/#forbidden-host-code-point)).

The situation is paradoxical, because parser himself percent encodes some code points, actually producing invalid serialized URLs according to the current standard. 

URL's from #148 to test issue:
`unknown://%E2%80%A0/`
`notspecial://H%4fSt/path`

**Solution**
I suggest that forbidden host code points be checked on percent decoded code points. The decoded data will be used only for this purpose, so the <var>output</var> will not be affected by this change.

Also this is a closer to [special URLs host validity check](https://url.spec.whatwg.org/#concept-host-parser).
You can view, comment on, or merge this pull request online at:

  https://github.com/whatwg/url/pull/218

-- Commit Summary --

  * Fix: allow valid percent encoded code points in the host of non-special URL

-- File Changes --

    M url.bs (7)

-- Patch Links --

https://github.com/whatwg/url/pull/218.patch
https://github.com/whatwg/url/pull/218.diff

-- 
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/pull/218

Received on Thursday, 26 January 2017 19:33:27 UTC