commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Erhan Bagdemir (Commented) (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (VALIDATOR-298) URL with parenthese is not valid
Date Mon, 21 Nov 2011 20:36:52 GMT

    [ https://issues.apache.org/jira/browse/VALIDATOR-298?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13154467#comment-13154467
] 

Erhan Bagdemir commented on VALIDATOR-298:
------------------------------------------

Try, "http://www.google.com/abv(de)" instead.

Associated test case is in UrlValidatorTest:140 

   public void testValidator218() {
       UrlValidator validator = new UrlValidator(UrlValidator.ALLOW_2_SLASHES);
       assertTrue("parentheses should be valid in URLs",
               validator.isValid("http://somewhere.com/pathxyz/file(1).html"));
   }

The unit test could run clearly with a valid scheme in a test url, such as "http://", "https://"
or "ftp://". 

                
> URL with parenthese is not valid
> --------------------------------
>
>                 Key: VALIDATOR-298
>                 URL: https://issues.apache.org/jira/browse/VALIDATOR-298
>             Project: Commons Validator
>          Issue Type: Bug
>            Reporter: yuhang
>
> The class org.apache.commons.validator.UrlValidator rejects certain valid URL
> According to RFC1738:
> -------------
> HTTP
> httpurl        = "http://" hostport [ "/" hpath [ "?" search ]]
> hpath          = hsegment *[ "/" hsegment ]
> hsegment       = *[ uchar | ";" | ":" | "@" | "&" | "=" ]
> search         = *[ uchar | ";" | ":" | "@" | "&" | "=" ]
> -------------
> the httpurl is allowed to contain the parenthese("("|")").
> But the urlvalidator reject it.
> e.g.
> url: www.google.com/abv(de)
> urlvalidator.isValid(url) = false;
> but it's a valid url,in fact.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message