Re: [whatwg/url] Forbidden host code points should include all C0 controls & U+007F (#627)

Thanks, excellent!

> I suspect we might not want to have things result in failure there as that would end up with things throwing that currently do not throw in either Chrome or Firefox.

Note though, that Chrome and Firefox still parse non-special URLs as not having a host at all, so I'm not sure if this should be a concern. 

I got stuck when trying to update the opaque-host-parser:

- Should `new URL ('sc://a\x01b')` fail, or should it normalise to `sc://a%01b`? 
  Note that `new URL ('sc://a\x00b')` and `new URL ('sc://a b')` do fail. I think we should prefer a consistent solution. 

- The second question I had is if the host setter should maybe be more liberal about this than the parser. 
  One can fail on `new URL ('sc://a b')` but allow `nonspecialUrl.host = 'a b'` by percent-encoding the space, and similarily the other forbidden codepoints. 


-- 
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/627#issuecomment-968735607

Received on Monday, 15 November 2021 10:13:22 UTC