You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Willem Jiang (JIRA)" <ji...@apache.org> on 2015/04/22 13:37:58 UTC

[jira] [Commented] (CAMEL-8518) Lack of url encoding of square braces [] in camel http component causes URISyntaxException

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

Willem Jiang commented on CAMEL-8518:
-------------------------------------

Hi Ed,
The '[' and ']' are removed from Http endpoint due to CAMEL-6914 for supporting the IPV6.
So I just have a quick question for you.
What's your proxy camel route looks like? 
I think you may need to encod the uri path yourself to avoid the  java.net.URISyntaxException.


> Lack of url encoding of square braces [] in camel http component causes URISyntaxException
> ------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-8518
>                 URL: https://issues.apache.org/jira/browse/CAMEL-8518
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.14.1
>            Reporter: Edward Welch
>            Assignee: Willem Jiang
>
> I'm using camel as an HTTP proxy server for Kibana, when creating a new index in kibana, it uses a url that contains square braces:
> http://localhost:5601/elasticsearch/.kibana/index-pattern/[logstash-]YYYY.MM.DD
> This leads to a java.net.URISyntaxException in the HttpHelper class createURI method, on the first line where it tries to instantiate a URI.
> I believe this may easily be fixed by adding square braces to the list of chars which need encoding in the UnsafeUriCharactersEncoder.encodeHttpURI method.  This method is being called on line 215 of the HttpHelper class earlier in the processing.
> Adding '[' and ']' to the static unsafeCharactersHttp initializer should cause those characters to be encoded and prevent this exception.
> I see there is an unsafeCharactersRfc1738 set, which includes square braces, perhaps this could be used instead? I'm not sure the reason there are separate characters lists in this class.
> Thanks,
> Ed



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