camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Björn Paulsen (JIRA) <j...@apache.org>
Subject [jira] [Updated] (CAMEL-9590) Camel decode URI wrong
Date Thu, 11 Feb 2016 11:12:18 GMT

     [ https://issues.apache.org/jira/browse/CAMEL-9590?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Björn Paulsen updated CAMEL-9590:
---------------------------------
    Description: 
When using a plus sign "+" in the URI, camel translate the URI wrong. Same Problem when encode
the URI first.

Here is a Example:

public class defaultRoutes extends RouteBuilder {

	public void configure() throws UnsupportedEncodingException {

    		String url = "plus +wrong";

    		System.err.println("URL before: " + url); // Output plus +wrong

    		String encodedUrl = URLEncoder.encode(url, "UTF-8");

    		System.err.println("URL after encoding: " + encodedUrl); // Output plus+%2Bwrong <-
This is right

    		// In Route it calls the URL http4://www.google.de/webhp?q=plus++

    		// and not http4://www.google.de/webhp?q=plus+%2bwrong

    		from("timer://foo?fixedRate=true&period=10000")

    			.to("http4://www.google.de/webhp?q="+encodedUrl)

    			.to("activemq:testPlus");

  	}

}

To see the wrong Url, put the Log Level to INFO


  was:
When using a plus sign "+" in the URI, camel translate the URI wrong. Same Problem when encode
the URI first.

Here is a Example:

public class defaultRoutes extends RouteBuilder {
	public void configure() throws UnsupportedEncodingException {
    		String url = "plus +wrong";
    		System.err.println("URL before: " + url); // Output plus +wrong
    		String encodedUrl = URLEncoder.encode(url, "UTF-8");
    		System.err.println("URL after encoding: " + encodedUrl); // Output plus+%2Bwrong <-
This is right

    		// In Route it calls the URL http4://www.google.de/webhp?q=plus++
    		// and not http4://www.google.de/webhp?q=plus+%2bwrong
    		from("timer://foo?fixedRate=true&period=10000")
    			.to("http4://www.google.de/webhp?q="+encodedUrl)
    			.to("activemq:testPlus");
  	}
}

To see the wrong Url, put the Log Level to INFO



> Camel decode URI wrong
> ----------------------
>
>                 Key: CAMEL-9590
>                 URL: https://issues.apache.org/jira/browse/CAMEL-9590
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-http4
>    Affects Versions: 2.15.5, 2.16.2
>         Environment: Windows 10, Eclipse
>            Reporter: Björn Paulsen
>
> When using a plus sign "+" in the URI, camel translate the URI wrong. Same Problem when
encode the URI first.
> Here is a Example:
> public class defaultRoutes extends RouteBuilder {
> 	public void configure() throws UnsupportedEncodingException {
>     		String url = "plus +wrong";
>     		System.err.println("URL before: " + url); // Output plus +wrong
>     		String encodedUrl = URLEncoder.encode(url, "UTF-8");
>     		System.err.println("URL after encoding: " + encodedUrl); // Output plus+%2Bwrong
<- This is right
>     		// In Route it calls the URL http4://www.google.de/webhp?q=plus++
>     		// and not http4://www.google.de/webhp?q=plus+%2bwrong
>     		from("timer://foo?fixedRate=true&period=10000")
>     			.to("http4://www.google.de/webhp?q="+encodedUrl)
>     			.to("activemq:testPlus");
>   	}
> }
> To see the wrong Url, put the Log Level to INFO



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

Mime
View raw message