You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2022/11/11 11:03:42 UTC

[camel] 03/04: Netty-Http component: header parameters cannot start with a whitespace

This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 1499151c1645f05b01f7ca2823a0637e61e13ddc
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Nov 11 12:02:33 2022 +0100

    Netty-Http component: header parameters cannot start with a whitespace
    
    Signed-off-by: Andrea Cosentino <an...@gmail.com>
---
 .../http/NettyHttpGetWithParamAsExchangeHeaderTest.java      | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

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 9e2a92a6d11..cbeea0ad1cb 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
@@ -68,11 +68,11 @@ public class NettyHttpGetWithParamAsExchangeHeaderTest extends BaseNettyTest {
     public void testHttpGetWithSpaceEncodedInParams() throws Exception {
         MockEndpoint mock = getMockEndpoint("mock:result");
         mock.expectedMessageCount(1);
-        mock.expectedHeaderReceived("message", " World");
+        mock.expectedHeaderReceived("message", "Wor ld");
         mock.expectedHeaderReceived(Exchange.HTTP_METHOD, "GET");
 
         // parameter starts with a space using %20 as decimal encoded
-        template.requestBody(serverUri + "&message=%20World", null, Object.class);
+        template.requestBody(serverUri + "&message=Wor%20ld", null, Object.class);
 
         MockEndpoint.assertIsSatisfied(context);
     }
@@ -81,11 +81,11 @@ public class NettyHttpGetWithParamAsExchangeHeaderTest extends BaseNettyTest {
     public void testHttpGetWithSpaceInParams() throws Exception {
         MockEndpoint mock = getMockEndpoint("mock:result");
         mock.expectedMessageCount(1);
-        mock.expectedHeaderReceived("message", " World");
+        mock.expectedHeaderReceived("message", "Wor ld");
         mock.expectedHeaderReceived(Exchange.HTTP_METHOD, "GET");
 
         // parameter starts with a space
-        template.requestBody(serverUri + "&message= World", null, Object.class);
+        template.requestBody(serverUri + "&message=Wor ld", null, Object.class);
 
         MockEndpoint.assertIsSatisfied(context);
     }
@@ -94,11 +94,11 @@ public class NettyHttpGetWithParamAsExchangeHeaderTest extends BaseNettyTest {
     public void testHttpGetWithSpaceAsPlusInParams() throws Exception {
         MockEndpoint mock = getMockEndpoint("mock:result");
         mock.expectedMessageCount(1);
-        mock.expectedHeaderReceived("message", " World");
+        mock.expectedHeaderReceived("message", "Wor ld");
         mock.expectedHeaderReceived(Exchange.HTTP_METHOD, "GET");
 
         // parameter starts with a space
-        template.requestBody(serverUri + "&message=+World", null, Object.class);
+        template.requestBody(serverUri + "&message=Wor+ld", null, Object.class);
 
         MockEndpoint.assertIsSatisfied(context);
     }