You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Adrian Crum (JIRA)" <ji...@apache.org> on 2015/09/25 22:39:04 UTC

[jira] [Comment Edited] (VALIDATOR-375) UrlValidator fails on IPv6 URL

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

Adrian Crum edited comment on VALIDATOR-375 at 9/25/15 8:38 PM:
----------------------------------------------------------------

This line is generating an empty host name string when an IPv6 address is used:

{code}
        String hostLocation = authorityMatcher.group(PARSE_AUTHORITY_HOST_IP);
{code}

So, the regex is flawed. I'm not a regex expert. If anyone can provide a patch for the regex, I will test it and commit it.


was (Author: adrianc@hlmksw.com):
This line is generating an empty host name string when an IP address is used:

{code}
        String hostLocation = authorityMatcher.group(PARSE_AUTHORITY_HOST_IP);
{code}

So, the regex is flawed. I'm not a regex expert. If anyone can provide a patch for the regex, I will test it and commit it.

> UrlValidator fails on IPv6 URL
> ------------------------------
>
>                 Key: VALIDATOR-375
>                 URL: https://issues.apache.org/jira/browse/VALIDATOR-375
>             Project: Commons Validator
>          Issue Type: Bug
>          Components: Routines
>    Affects Versions: 1.4.1 Release
>            Reporter: George Stanchev
>         Attachments: UrlValidatorTest.java.patch
>
>
> I have created an UrlValidator:
> String[] schemes = {"http", "https"};
> UrlValidator urlValidator = new UrlValidator(schemes, UrlValidator.ALLOW_LOCAL_URLS);
> urlValidator.isValid("https://[fe80::8e0:6afa:a2d5:1c8a]/myapp")
> evaluates to false.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)