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

Claus Ibsen commented on CAMEL-21197:
-------------------------------------

Camel has its own code for parsing its endpoints that resemble URIs and have 
various optimized code for this.

This code is NOT intended as general purpose URI utils for any end users or 
whatever they do. Its for working with Camel.

The issue was an Oracle TX manager that has some issue - focus on fixing it 
there.

Camel v5 has a goal of changing this URI endpoint parsing inside Camel (there 
is a Jira ticket somewhere).

 

> URISupport.parseQuery is not decoding correctly
> -----------------------------------------------
>
>                 Key: CAMEL-21197
>                 URL: https://issues.apache.org/jira/browse/CAMEL-21197
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 4.7.0
>            Reporter: Dirk Fiedler
>            Priority: Minor
>
> {color:#000000}Hi team,{color}
> {color:#000000}while using *URISupport.parseQuery* the given query was not 
> correctly decoded:{color}
> *{color:#000000}Sample JUnit test 
> (org.apache.camel.util.URISupportTest):{color}*
>  
> {code:java}
> @Test
> public void testParseQueryDFi() throws Exception {
>     Map<String, Object> map = 
> URISupport.parseQuery("Camel-Saga-Complete=direct%3A%2F%2Fsaga1_sagaService_complete");
>     assertEquals(1, map.size());
>     assertEquals("direct://saga1_sagaService_complete", 
> map.get("Camel-Saga-Complete"));
> } {code}
> {color:#000000}If i handover the query 
> 'Camel-Saga-Complete=direct%3A%2F%2Fsaga1_sagaService_complete' 
> i expect the decoded value {color}{color:#000000}for 'Camel-Saga-Complete' as 
> 'direct://saga1_sagaService_complete'.{color}
> {color:#000000}I am wrong? Did i understand the utility class wrong?{color}
> {color:#000000}Within the code i can see, that the string was adjusted to 
> replace '%', this is {color}
> {color:#000000}causing the issue:{color}
> *{color:#000000}URIScanner.addParameter:{color}*
>  
> {code:java}
> if (isRaw) {
>     text = value.toString();
> } else {
>     // need to replace % with %25 to avoid losing "%" when decoding
>     final String s = replacePercent(value.toString());    
>     text = URLDecoder.decode(s, CHARSET);
> }{code}
>  
> {color:#000000}best regards{color}
> {color:#000000}Dirk{color}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to