Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and
privacy statement. We’ll occasionally send you account related emails.
Already on GitHub?
to your account
probably because of this code
// allowed hostname characters according to RFC 3986
// ALPHA DIGIT "-" "." "_" "~" "!" "$" "&" "'" "(" ")" "*" "+" "," ";" "=" %encoded
// I've never seen a (non-IDN) hostname other than: ALPHA DIGIT . -
URI.invalid_hostname_characters = /[^a-zA-Z0-9\.-]/;
The text was updated successfully, but these errors were encountered:
Do you want to send a PR for that? (maybe also adding an URL with a _ in its domain to urls.js for testing)
Sorry, something went wrong.
sure ill send a pr
submitted a PR with a relevant test:
@rodneyrehm is there a possibility to have
the hostname could be an IPv6 address and that may contain :. A domain name may not - as far as I know - but then, I wasn't aware _ was legal either…
host:name.something.com currently fails in tests because name.something.com is considered the port
so the hostname i test is now:
var u = new URI('http://some.complex_host-name123.org/');
When you opened the PR I thought I'd immediately close the issue because _ is not legal in domain names per RFC 1034. However, the URL spec seems to permit it and Chrome's implementation parses it. That said, : is considered an illegal code point
gotcha. so the PR can be merged i think.
fix(parse): allow _ in hostnames (#347 #348)
fixed in v1.18.12
No branches or pull requests