Skip to content
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

namehash does not throw an error, and it errors if input has &_@ etc. #3

Open
theporpoise opened this issue May 28, 2017 · 1 comment

Comments

@theporpoise
Copy link

theporpoise commented May 28, 2017

when validating user input it is necessary to remove parameters from namehash that will throw an error.

I end up doing this a lot:
var valid = namehash.normalize(str.replace(/ |&_|@/g,''));

I'd be up for reading the spec on idna-uts46 if there was interest in making a:
namehash.valinput()

edit: I'm new to working on github, so please let me know the steps to contribute. apologies in advance for my ignorance!

@danfinlay
Copy link
Collaborator

Hi, sorry for not replying here, I guess I was busy, and don't have a contributing guide.

Pull requests welcome! Just add a test for the validation you'd like to enforce, this sounds reasonable, I'd merge it if PR'd.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants