adopted-ember-addons / ember-validators

A collection of EmberJS validators
Other
24 stars 40 forks source link

[email regex] require a TLD with a minimum length of 2 #15

Closed aaronlelevier closed 7 years ago

aaronlelevier commented 7 years ago

I'd like to make a pull request for email validation for a minimum TLD length of 2.

We have some backend validation that says the TLD length should be between 2 and 63. I did some research, and there aren't any registered length of 1 TLD's. An RFC says the max length should be 63. Not sure if the max length validation is excessive though, so didn't add it in this pull request.

snewcomer commented 7 years ago

There are some Rails gems that enforce min 2 as well.

offirgolan commented 7 years ago

I think this is a breaking change that would require a new major version release. Maybe we can have an option such as minTldLength that is defaulted to 1?

Edit:

I did some research, and there aren't any registered length of 1 TLD's

This could be in case of public TLD's but there could exist private / corporate TLD of 1 char.

snewcomer commented 7 years ago

@aronysidoro can you close this pull request?

offirgolan commented 7 years ago

Closing in favor of #39