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

Hadrian Zbarcea commented on CAMEL-4954:
----------------------------------------

@Sebastian, I committed a fix, actually more like a workaround on trunk. It 
took a while because I had to run the full tests to make sure I didn't break 
something. A better fix is possible and get rid of the double decode, but that 
only after we fix all components to not rely on unsafe URIs and then we can 
remove the double decode and more importantly the normalize.

It should work for you now. It would be great if you could test it from trunk. 
I will merge to 2.9.1 in a few hours.
                
> Camel 2.9.0 incapable of working with % in endpoint URIs
> --------------------------------------------------------
>
>                 Key: CAMEL-4954
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4954
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.9.0
>         Environment: Mac 10.7 Java 1.6.0_29
>            Reporter: Sebastian Rühl
>            Assignee: Hadrian Zbarcea
>            Priority: Critical
>             Fix For: 2.9.1, 2.10.0
>
>         Attachments: PercentTest.java
>
>
> In the class org.apache.camel.util.URISupport which will be used to resolve 
> endpoints (DefaultCamelContext#normalizeEndpointUri) the method 
> parseParameters will be called.
> At first the java.net.Uri#getQuery will be called with according to the 
> javadoc "Returns the decoded query component of this URI" returns a decoded 
> URI. If that fails the java.net.Uri#getSchemeSpecificPart method will be 
> called which according to the javadoc "Returns the decoded scheme-specific 
> part of this URI." returns a decoded URI.
> So to summarize we get in any case a decoded URI.
> This URI will then be than in the method 
> org.apache.camel.util.URISupport#parseQuery(String) again decoded with 
> java.net.URLDecoder#decode(String,String).
> This code leads to the following behaviour:
>  If a % is properly encoded with %25test the %25test will be substituted by 
> the first call to %test and the decoded again which leads to an Exception.
> In the http://svn.apache.org/viewvc?view=revision&revision=1166508 commit you 
> can see that the % was uncommented from 
> org.apache.camel.util#UnsafeUriCharactersEncoder. Maybe this is related.
> However... Double encoding of URIs seems quite odd. With any URI char there 
> is no issue with that. But with % the % will be decoded again, which makes a 
> % unusable in Camel.

--
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


Reply via email to