commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From S├ębastien De Nef <>
Subject [validator] EmailValidator accept empty domain names
Date Thu, 22 Oct 2015 07:05:14 GMT
Hi everybody,

First, sorry for my english.

I tried the EmailValidator component and I was surprised that it accepts a
domain part that contains only the TLD (like See below a failing

Although domainValidator.isValid(domain) returns false
domainValidator.isValid(domain) || domainValidator.isValidTld(domain)
returns true
Is it the source of the problem ? Why does it bypass the domain validation
if the TLD is valid ?
NB: DomainValidator.isValid already contains isValidTld()


* Tests the email validation for empty domain.
public void testEmailWithEmptyDomain()  {
    assertFalse("empty domain name should fail",
    assertFalse("domain name starting with dot should fail",
    assertFalse("domain name with only TLD should fail",
emailValidator.commonsValidator("")); // yes or no ?

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message