You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Jamshid Afshar <ja...@gmail.com> on 2013/11/09 21:10:44 UTC

[validator] Should "http://fooserver.local" really be considered invalid?

Hi, is "http://fooserver.local" intentionally considered an "invalid"
url? It fails even if I use UrlValidator.ALLOW_LOCAL_URLS.

    private static final String[] ALLOWED_SCHEMES ={"http","https"};

    public static final UrlValidator URL_VALIDATOR = new
UrlValidator(ALLOWED_SCHEMES, UrlValidator.ALLOW_LOCAL_URLS);

    if (!URL_VALIDATOR.isValid("http://fooserver.local")) { ...report error... }

Maybe "local" should be added to:

private static final String[] LOCAL_TLDS = new String[] {
   "localhost",           // RFC2606 defined
   "localdomain"          // Also widely used as localhost.localdomain
};

I know, ".local" has a checkered past:
http://en.wikipedia.org/wiki/.local, but it is widely used in server
names and testing.

Or maybe there is an easy option to consider any TLD valid. Anyway, so
many are being added.

Thanks,
Jamshid

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org