[hibernate-issues] [Hibernate-JIRA] Commented: (HV-513) URL validator rejects protocols the JVM does not know about

Pasi Eronen (JIRA) noreply at atlassian.com
Wed Sep 28 07:35:37 EDT 2011


    [ http://opensource.atlassian.com/projects/hibernate/browse/HV-513?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43755#comment-43755 ] 

Pasi Eronen commented on HV-513:
--------------------------------

Good question. One possibility might be the java.net.URI(String) constructor, but it seems to be quite lax about checking anything.

On the other hand, the current behavior is a bit strange because the validity does not depend only on the URL string, but also the exact JRE version, what system properties you have set, and what's on your classpath.

> URL validator rejects protocols the JVM does not know about
> -----------------------------------------------------------
>
>                 Key: HV-513
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HV-513
>             Project: Hibernate Validator
>          Issue Type: Bug
>          Components: validators
>    Affects Versions: 4.1.0.Final, 4.2.0.Final
>            Reporter: Pasi Eronen
>
> URLValidator uses java.net.URL(String) constructor to check whether an URL is valid. However, this constructor rejects a protocol unless the JVM has
> an URLStreamHandler for it.
> So perfectly valid URLs such as "ldap://localhost/ou=Foo" and "sip:alice at example.com" are rejected.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list