Updated Branches: refs/heads/master 6aebbb391 -> be6876ea7
CAMEL-7060: camel-netty-http - Do not url decode headers by default Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/be6876ea Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/be6876ea Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/be6876ea Branch: refs/heads/master Commit: be6876ea72c9f119e8c571682709c3ca1a2a7865 Parents: 6aebbb3 Author: Claus Ibsen <davscl...@apache.org> Authored: Wed Dec 11 16:54:04 2013 +0100 Committer: Claus Ibsen <davscl...@apache.org> Committed: Wed Dec 11 16:54:14 2013 +0100 ---------------------------------------------------------------------- .../component/netty/http/NettyHttpConfiguration.java | 2 +- .../http/NettyHttpEndpointUriEncodingIssueTest.java | 2 +- .../http/NettyHttpGetWithParamAsExchangeHeaderTest.java | 12 ++++++------ .../netty/http/NettyHttpProducerQueryParamTest.java | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/be6876ea/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpConfiguration.java ---------------------------------------------------------------------- diff --git a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpConfiguration.java b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpConfiguration.java index 509ea02..e4f37b4 100644 --- a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpConfiguration.java +++ b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpConfiguration.java @@ -28,7 +28,7 @@ import org.jboss.netty.channel.ChannelHandler; */ public class NettyHttpConfiguration extends NettyConfiguration { - private boolean urlDecodeHeaders = true; + private boolean urlDecodeHeaders; private boolean mapHeaders = true; private boolean compression; private boolean throwExceptionOnFailure = true; http://git-wip-us.apache.org/repos/asf/camel/blob/be6876ea/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpEndpointUriEncodingIssueTest.java ---------------------------------------------------------------------- diff --git a/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpEndpointUriEncodingIssueTest.java b/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpEndpointUriEncodingIssueTest.java index ebb27f0..770e8ad 100644 --- a/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpEndpointUriEncodingIssueTest.java +++ b/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpEndpointUriEncodingIssueTest.java @@ -44,7 +44,7 @@ public class NettyHttpEndpointUriEncodingIssueTest extends BaseNettyTest { return new RouteBuilder() { @Override public void configure() throws Exception { - from("netty-http:http://localhost:{{port}}/myapp/mytest").process(new Processor() { + from("netty-http:http://localhost:{{port}}/myapp/mytest?urlDecodeHeaders=true").process(new Processor() { public void process(Exchange exchange) throws Exception { String columns = exchange.getIn().getHeader("columns", String.class); exchange.getOut().setBody("We got " + columns + " columns"); http://git-wip-us.apache.org/repos/asf/camel/blob/be6876ea/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpGetWithParamAsExchangeHeaderTest.java ---------------------------------------------------------------------- diff --git a/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpGetWithParamAsExchangeHeaderTest.java b/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpGetWithParamAsExchangeHeaderTest.java index ebb15a2..22ad2c8 100644 --- a/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpGetWithParamAsExchangeHeaderTest.java +++ b/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpGetWithParamAsExchangeHeaderTest.java @@ -24,7 +24,7 @@ import org.junit.Test; public class NettyHttpGetWithParamAsExchangeHeaderTest extends BaseNettyTest { - private String serverUri = "netty-http:http://localhost:" + getPort() + "/myservice"; + private String serverUri = "netty-http:http://localhost:" + getPort() + "/myservice?urlDecodeHeaders=true"; @Test public void testHttpGetWithParamsViaURI() throws Exception { @@ -34,7 +34,7 @@ public class NettyHttpGetWithParamAsExchangeHeaderTest extends BaseNettyTest { mock.expectedHeaderReceived("two", "twei"); mock.expectedHeaderReceived(Exchange.HTTP_METHOD, "GET"); - template.requestBody(serverUri + "?one=einz&two=twei", null, Object.class); + template.requestBody(serverUri + "&one=einz&two=twei", null, Object.class); assertMockEndpointsSatisfied(); } @@ -46,7 +46,7 @@ public class NettyHttpGetWithParamAsExchangeHeaderTest extends BaseNettyTest { mock.expectedHeaderReceived("message", "Keine g\u00FCltige GPS-Daten!"); mock.expectedHeaderReceived(Exchange.HTTP_METHOD, "GET"); - template.requestBody(serverUri + "?message=Keine%20g%C3%BCltige%20GPS-Daten!", null, Object.class); + template.requestBody(serverUri + "&message=Keine%20g%C3%BCltige%20GPS-Daten!", null, Object.class); assertMockEndpointsSatisfied(); } @@ -59,7 +59,7 @@ public class NettyHttpGetWithParamAsExchangeHeaderTest extends BaseNettyTest { mock.expectedHeaderReceived("message", "Keine g\u00C6ltige GPS-Daten!"); mock.expectedHeaderReceived(Exchange.HTTP_METHOD, "GET"); - template.requestBody(serverUri + "?message=Keine+g%C6ltige+GPS-Daten%21", null, Object.class); + template.requestBody(serverUri + "&message=Keine+g%C6ltige+GPS-Daten%21", null, Object.class); assertMockEndpointsSatisfied(); } @@ -72,7 +72,7 @@ public class NettyHttpGetWithParamAsExchangeHeaderTest extends BaseNettyTest { mock.expectedHeaderReceived(Exchange.HTTP_METHOD, "GET"); // parameter starts with a space using %2B as decimal encoded - template.requestBody(serverUri + "?message=%2BWorld", null, Object.class); + template.requestBody(serverUri + "&message=%2BWorld", null, Object.class); assertMockEndpointsSatisfied(); } @@ -85,7 +85,7 @@ public class NettyHttpGetWithParamAsExchangeHeaderTest extends BaseNettyTest { mock.expectedHeaderReceived(Exchange.HTTP_METHOD, "GET"); // parameter starts with a space using + decoded - template.requestBody(serverUri + "?message=+World", null, Object.class); + template.requestBody(serverUri + "&message=+World", null, Object.class); assertMockEndpointsSatisfied(); } http://git-wip-us.apache.org/repos/asf/camel/blob/be6876ea/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpProducerQueryParamTest.java ---------------------------------------------------------------------- diff --git a/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpProducerQueryParamTest.java b/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpProducerQueryParamTest.java index 0b7fe09..14bd6d9 100644 --- a/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpProducerQueryParamTest.java +++ b/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpProducerQueryParamTest.java @@ -25,11 +25,11 @@ import org.junit.Test; public class NettyHttpProducerQueryParamTest extends BaseNettyTest { - private String url = "netty-http:http://0.0.0.0:" + getPort() + "/cheese"; + private String url = "netty-http:http://0.0.0.0:" + getPort() + "/cheese?urlDecodeHeaders=true"; @Test public void testQueryParameters() throws Exception { - Exchange exchange = template.request(url + "?quote=Camel%20rocks", null); + Exchange exchange = template.request(url + ""e=Camel%20rocks", null); assertNotNull(exchange); String body = exchange.getOut().getBody(String.class);