-
Notifications
You must be signed in to change notification settings - Fork 167
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
Use WHATWG URL for url and email validation #203
Comments
In order to do that, we'd have to ship the entire URL polyfill to browsers - or require that users do it. The polyfill still seems prohibitively large. (also, in general, email validation that's anything more than "it has an @, and you can receive an email sent to it" is useless, so I'm not interested in making email validation "better", when it needs to be reduced, not increased) |
Checking an email address for a correct IDNA is no less useful than checking a URL for the same. Email servers adhere to the same IP and DNS rules as a web server. |
They're slightly different, To clarify: does |
|
It would help if you could provide sets of non-IDNA test cases that pass with your shim, but fail with the current implementation - that would help me understand the risk/reward. |
require("forms/lib/validators").url(false)(null, {
data: "http://[2001:0db8:85a3:0000:0000:8a2e:0370:7334]"
}, result => console.log(result))
//-> Please enter a valid URL. |
Thanks - so, these are the categories of URLs that using universal-url would allow to be valid:
These are the categories of URLs that currently already work:
Any others? |
This library currently only supports http, https and ftp. |
OK, I've edited my list above. Any other categories? |
That's all I can think of at the moment. |
Via universal-url as it covers far more edge cases such as IDNAs and IPv6 than a simple regex will.
The text was updated successfully, but these errors were encountered: