You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ja...@apache.org on 2023/05/11 11:55:39 UTC

[camel] branch camel-3.18.x updated (ee5afad933b -> c4799ec6877)

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

jamesnetherton pushed a change to branch camel-3.18.x
in repository https://gitbox.apache.org/repos/asf/camel.git


    from ee5afad933b [3.18.x] Backports (#10034)
     new 37776b2a46f Netty-Http component: header parameters cannot start with a whitespace
     new a5c87b8ffb5 Netty-Http component: header parameters cannot start with a whitespace
     new c4799ec6877 Netty-Http Encoding test: Do not log body and headers

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../component/netty/http/NettyHttpBridgeEncodedPathTest.java |  8 ++++----
 .../http/NettyHttpGetWithParamAsExchangeHeaderTest.java      | 12 ++++++------
 2 files changed, 10 insertions(+), 10 deletions(-)


[camel] 03/03: Netty-Http Encoding test: Do not log body and headers

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jamesnetherton pushed a commit to branch camel-3.18.x
in repository https://gitbox.apache.org/repos/asf/camel.git

commit c4799ec687752e9cb2323d536acc25e0317ed2bd
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Nov 11 12:56:47 2022 +0100

    Netty-Http Encoding test: Do not log body and headers
    
    Signed-off-by: Andrea Cosentino <an...@gmail.com>
---
 .../camel/component/netty/http/NettyHttpBridgeEncodedPathTest.java      | 2 --
 1 file changed, 2 deletions(-)

diff --git a/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpBridgeEncodedPathTest.java b/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpBridgeEncodedPathTest.java
index 795dc496f5f..8cdda630393 100644
--- a/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpBridgeEncodedPathTest.java
+++ b/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpBridgeEncodedPathTest.java
@@ -88,13 +88,11 @@ public class NettyHttpBridgeEncodedPathTest extends BaseNettyTest {
                 };
 
                 from("netty-http:http://localhost:" + port2 + "/nettyTestRouteA?matchOnUriPrefix=true")
-                        .log("${body} ${headers}")
                         .log("Using NettyTestRouteA route: CamelHttpPath=[${header.CamelHttpPath}], CamelHttpUri=[${header.CamelHttpUri}]")
                         .to("netty-http:http://localhost:" + port1
                             + "/nettyTestRouteB?throwExceptionOnFailure=false&bridgeEndpoint=true");
 
                 from("netty-http:http://localhost:" + port1 + "/nettyTestRouteB?matchOnUriPrefix=true")
-                        .log("${body} ${headers}")
                         .log("Using NettyTestRouteB route: CamelHttpPath=[${header.CamelHttpPath}], CamelHttpUri=[${header.CamelHttpUri}]")
                         .process(serviceProc);
 


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

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jamesnetherton pushed a commit to branch camel-3.18.x
in repository https://gitbox.apache.org/repos/asf/camel.git

commit a5c87b8ffb54202fd224dcc47a370c33adb3d49f
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Nov 11 11:55:03 2022 +0100

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

diff --git a/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpBridgeEncodedPathTest.java b/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpBridgeEncodedPathTest.java
index 5f5c947519e..795dc496f5f 100644
--- a/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpBridgeEncodedPathTest.java
+++ b/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpBridgeEncodedPathTest.java
@@ -45,9 +45,9 @@ public class NettyHttpBridgeEncodedPathTest extends BaseNettyTest {
 
     @Test
     public void testEncodedQuery() {
-        String response = template.requestBody("http://localhost:" + port2 + "/nettyTestRouteA?param1=%2B447777111222", null,
+        String response = template.requestBody("http://localhost:" + port2 + "/nettyTestRouteA?param1=44777%2B7111222", null,
                 String.class);
-        assertEquals("param1=+447777111222", response, "Get a wrong response");
+        assertEquals("param1=44777+7111222", response, "Get a wrong response");
     }
 
     @Test
@@ -80,19 +80,21 @@ public class NettyHttpBridgeEncodedPathTest extends BaseNettyTest {
                     // %2B becomes decoded to a space
                     Object s = exchange.getIn().getHeader("param1");
                     // can be either + or %2B
-                    assertTrue(s.equals(" 447777111222") || s.equals("%20447777111222") || s.equals("+447777111222")
-                            || s.equals("%2B447777111222"));
+                    assertTrue(s.equals("44777 7111222") || s.equals("44777%207111222") || s.equals("44777+7111222")
+                            || s.equals("44777%2B7111222"));
 
                     // send back the query
                     exchange.getMessage().setBody(exchange.getIn().getHeader(Exchange.HTTP_QUERY));
                 };
 
                 from("netty-http:http://localhost:" + port2 + "/nettyTestRouteA?matchOnUriPrefix=true")
+                        .log("${body} ${headers}")
                         .log("Using NettyTestRouteA route: CamelHttpPath=[${header.CamelHttpPath}], CamelHttpUri=[${header.CamelHttpUri}]")
                         .to("netty-http:http://localhost:" + port1
                             + "/nettyTestRouteB?throwExceptionOnFailure=false&bridgeEndpoint=true");
 
                 from("netty-http:http://localhost:" + port1 + "/nettyTestRouteB?matchOnUriPrefix=true")
+                        .log("${body} ${headers}")
                         .log("Using NettyTestRouteB route: CamelHttpPath=[${header.CamelHttpPath}], CamelHttpUri=[${header.CamelHttpUri}]")
                         .process(serviceProc);
 


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

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jamesnetherton pushed a commit to branch camel-3.18.x
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 37776b2a46f34eb77b03d2d1055c777c5dba4345
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 f4658dc9445..14aedde39bf 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);
 
         assertMockEndpointsSatisfied();
     }
@@ -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);
 
         assertMockEndpointsSatisfied();
     }
@@ -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);
 
         assertMockEndpointsSatisfied();
     }