-
Notifications
You must be signed in to change notification settings - Fork 159
New issue
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? Sign in to your account
Is punycode.decode() a reasonable test for valid punycode FQDNs? #30
Comments
Well |
What @indolering said. |
Having just figured out that domain name labels are supposed to be passed through Nameprep first, I think the answer to this question is "no" or at least "Don't use punycode.js to lint unicode DNS labels because it doesn't perform normalization." |
Thanks @indolering! I kind of felt but couldn't turn into words what was wrong with the previous answer. My current understanding is that punicode only does punicode, i.e. it has no idea what a valid domain name is. I'll check out nameprep too! |
I gather nameprep is this spec: https://en.wikipedia.org/wiki/Nameprep ? |
@mikemaccana Correct. mathiasbynens/todo#9 seems relevant. |
I'm trying to check if a hostname string is a valid punycode/non-punycode FQDN. I can see that running:
Properly throws a RangeError which seems like it. But as this is a complex spec and I'm not sure after reading the docs: would
punycode.decode()
be considered a reasonable test of whether a string contains characters that would be invalid for punycode?I'm aware of other restrictions on URLs, eg, string length.
The text was updated successfully, but these errors were encountered: