commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jamshid Afshar <jamshi...@gmail.com>
Subject [validator] Should "http://fooserver.local" really be considered invalid?
Date Sat, 09 Nov 2013 20:10:44 GMT
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


Mime
View raw message