Max Gilead created VALIDATOR-326:
------------------------------------

             Summary: Configure DomainValidator to accept any well-formed TLDs
                 Key: VALIDATOR-326
                 URL: https://issues.apache.org/jira/browse/VALIDATOR-326
             Project: Commons Validator
          Issue Type: Improvement
            Reporter: Max Gilead


Currently DomainValidator can be put into 'allowLocal' mode which accepts any 
well-formed host names (like 'myhostname') but does not accept subdomains (like 
'myhostname.mynetwork'). Intranet networks are sometimes configured with 
unusual internal top-level domains and for such cases it's necessary to relax 
the check for a TLD to allow pretty much any well-formed domain.

The attached patch does that by adding another flag to the UrlValidator and 
exposing a new constructor in DomainValidator and EmailValidator. The patch is 
against the latest SVN as of 2013.12.09 (rev 1549539).

Please note this patch does not add any missing top-level domains or otherwise 
alter the existing behaviour.

Legal: I release this code into the public domain for anyone to use and 
relicense as they see fit; with no warranties of any kind.



--
This message was sent by Atlassian JIRA
(v6.1.4#6159)

Reply via email to