commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Asankhaya Sharma (JIRA)" <>
Subject [jira] [Created] (VALIDATOR-410) Failure cases for UrlValidator
Date Mon, 02 Jan 2017 10:29:58 GMT
Asankhaya Sharma created VALIDATOR-410:

             Summary: Failure cases for UrlValidator 
                 Key: VALIDATOR-410
             Project: Commons Validator
          Issue Type: Bug
    Affects Versions: 1.5.1
            Reporter: Asankhaya Sharma
            Priority: Minor

I was trying to check how closely the UrlValidator implements the URL grammar as described
by the RFC 1738 ( I fuzzed the UrlValidator with GramTest,
a grammar based test case generation tool ( 

I found that in the latest version 1.5.1, the UrlValidator fails to validate the following


These two strings may seem a bit strange, but I verified manually that they are allowed by
the grammar given in the RFC (see also 

Furthermore, it is possible to create the following URLs in Java without throwing a {{MalformedUrlException}}:

new URL("ftp:///+");
new URL("mailto:%FF@Z");

however, the UrlValidator returns false for these strings:

UrlValidator validator = new UrlValidator(UrlValidator.ALLOW_ALL_SCHEMES + UrlValidator.ALLOW_2_SLASHES
+ UrlValidator.ALLOW_LOCAL_URLS);
validator.isValid("ftp:///+"); // returns false
validator.isValid("mailto:%FF@Z"); // returns false

This message was sent by Atlassian JIRA

View raw message