You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2023/12/11 08:40:37 UTC

(camel) branch main updated (8e8b06922a7 -> 6dd17199c0a)

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

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


    from 8e8b06922a7 Bump com.couchbase.client:java-client from 3.5.0 to 3.5.1 (#12392)
     new fb197dc28ad CAMEL-20210: camel-core - Rest DSL Narrow content-type with charset fails clientRequestValidation
     new 6dd17199c0a Regen

The 2 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:
 .../rest/RestJettyInvalidContentTypeClientRequestValidationTest.java  | 2 +-
 .../camel/component/netty/http/HttpClientInitializerFactory.java      | 1 -
 .../java/org/apache/camel/component/netty/http/NettyHttpHelper.java   | 2 --
 .../java/org/apache/camel/component/netty/http/NettyHttpProducer.java | 1 -
 .../camel/component/netty/http/SecurityAuthenticatorSupport.java      | 2 --
 .../netty/http/NettyHttpHeaderFilterStrategyRemovalTest.java          | 4 ++--
 .../apache/camel/component/netty/http/NettyHttpSuspendResumeTest.java | 3 ++-
 .../camel/component/platform/http/vertx/VertxPlatformHttpSupport.java | 1 -
 .../src/main/java/org/apache/camel/processor/RestBindingAdvice.java   | 4 ++++
 9 files changed, 9 insertions(+), 11 deletions(-)


(camel) 02/02: Regen

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

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

commit 6dd17199c0ab44f63a13f48e86be977ec1b0aba1
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Mon Dec 11 09:40:27 2023 +0100

    Regen
---
 .../camel/component/netty/http/HttpClientInitializerFactory.java      | 1 -
 .../java/org/apache/camel/component/netty/http/NettyHttpHelper.java   | 2 --
 .../java/org/apache/camel/component/netty/http/NettyHttpProducer.java | 1 -
 .../camel/component/netty/http/SecurityAuthenticatorSupport.java      | 2 --
 .../netty/http/NettyHttpHeaderFilterStrategyRemovalTest.java          | 4 ++--
 .../apache/camel/component/netty/http/NettyHttpSuspendResumeTest.java | 3 ++-
 .../camel/component/platform/http/vertx/VertxPlatformHttpSupport.java | 1 -
 7 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/HttpClientInitializerFactory.java b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/HttpClientInitializerFactory.java
index f2045d91f86..6343b017a0c 100644
--- a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/HttpClientInitializerFactory.java
+++ b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/HttpClientInitializerFactory.java
@@ -17,7 +17,6 @@
 package org.apache.camel.component.netty.http;
 
 import java.net.URI;
-import java.util.Arrays;
 import java.util.List;
 import java.util.concurrent.TimeUnit;
 
diff --git a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpHelper.java b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpHelper.java
index 9a09ac2fbf0..21080697c7d 100644
--- a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpHelper.java
+++ b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpHelper.java
@@ -28,11 +28,9 @@ import io.netty.handler.codec.http.HttpMethod;
 import org.apache.camel.Exchange;
 import org.apache.camel.Message;
 import org.apache.camel.RuntimeExchangeException;
-import org.apache.camel.support.http.HttpUtil;
 import org.apache.camel.util.CollectionHelper;
 import org.apache.camel.util.IOHelper;
 import org.apache.camel.util.ObjectHelper;
-import org.apache.camel.util.StringHelper;
 import org.apache.camel.util.URISupport;
 import org.apache.camel.util.UnsafeUriCharactersEncoder;
 
diff --git a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpProducer.java b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpProducer.java
index 1a635445a38..f3d7e4cefd4 100644
--- a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpProducer.java
+++ b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/NettyHttpProducer.java
@@ -31,7 +31,6 @@ import org.apache.camel.component.netty.NettyConfiguration;
 import org.apache.camel.component.netty.NettyProducer;
 import org.apache.camel.http.base.cookie.CookieHandler;
 import org.apache.camel.support.SynchronizationAdapter;
-import org.apache.camel.util.StringHelper;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
diff --git a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/SecurityAuthenticatorSupport.java b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/SecurityAuthenticatorSupport.java
index d79c5c72365..fa6836f265f 100644
--- a/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/SecurityAuthenticatorSupport.java
+++ b/components/camel-netty-http/src/main/java/org/apache/camel/component/netty/http/SecurityAuthenticatorSupport.java
@@ -16,7 +16,6 @@
  */
 package org.apache.camel.component.netty.http;
 
-import java.io.IOException;
 import java.security.Principal;
 import java.util.Locale;
 
@@ -25,7 +24,6 @@ import javax.security.auth.callback.Callback;
 import javax.security.auth.callback.CallbackHandler;
 import javax.security.auth.callback.NameCallback;
 import javax.security.auth.callback.PasswordCallback;
-import javax.security.auth.callback.UnsupportedCallbackException;
 
 import org.apache.camel.support.ObjectHelper;
 import org.slf4j.Logger;
diff --git a/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpHeaderFilterStrategyRemovalTest.java b/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpHeaderFilterStrategyRemovalTest.java
index 908abc5704a..ae9b439e32f 100644
--- a/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpHeaderFilterStrategyRemovalTest.java
+++ b/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpHeaderFilterStrategyRemovalTest.java
@@ -27,8 +27,8 @@ import static org.apache.camel.Exchange.HTTP_QUERY;
 
 public class NettyHttpHeaderFilterStrategyRemovalTest extends BaseNettyTest {
 
-    @BindToRegistry("headerFilterStrategy") final
-    NettyHttpHeaderFilterStrategy headerFilterStrategy = new NettyHttpHeaderFilterStrategy();
+    @BindToRegistry("headerFilterStrategy")
+    final NettyHttpHeaderFilterStrategy headerFilterStrategy = new NettyHttpHeaderFilterStrategy();
 
     @EndpointInject("mock:test")
     MockEndpoint mockEndpoint;
diff --git a/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpSuspendResumeTest.java b/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpSuspendResumeTest.java
index 9097fbdf7b2..ff9da06c0ac 100644
--- a/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpSuspendResumeTest.java
+++ b/components/camel-netty-http/src/test/java/org/apache/camel/component/netty/http/NettyHttpSuspendResumeTest.java
@@ -32,7 +32,8 @@ import static org.junit.jupiter.api.Assertions.fail;
 @DisabledOnOs(OS.WINDOWS)
 public class NettyHttpSuspendResumeTest extends BaseNettyTest {
 
-    private final String serverUri = "netty-http:http://localhost:" + getPort() + "/cool?disconnect=true&send503whenSuspended=false";
+    private final String serverUri
+            = "netty-http:http://localhost:" + getPort() + "/cool?disconnect=true&send503whenSuspended=false";
 
     @Test
     public void testNettySuspendResume() {
diff --git a/components/camel-platform-http-vertx/src/main/java/org/apache/camel/component/platform/http/vertx/VertxPlatformHttpSupport.java b/components/camel-platform-http-vertx/src/main/java/org/apache/camel/component/platform/http/vertx/VertxPlatformHttpSupport.java
index 595cee8af9d..9230343a36e 100644
--- a/components/camel-platform-http-vertx/src/main/java/org/apache/camel/component/platform/http/vertx/VertxPlatformHttpSupport.java
+++ b/components/camel-platform-http-vertx/src/main/java/org/apache/camel/component/platform/http/vertx/VertxPlatformHttpSupport.java
@@ -21,7 +21,6 @@ import java.io.PrintWriter;
 import java.io.StringWriter;
 import java.nio.ByteBuffer;
 import java.nio.charset.StandardCharsets;
-import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;


(camel) 01/02: CAMEL-20210: camel-core - Rest DSL Narrow content-type with charset fails clientRequestValidation

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

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

commit fb197dc28add1338d18f19c5733cdde908d08a3a
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Mon Dec 11 09:39:06 2023 +0100

    CAMEL-20210: camel-core - Rest DSL Narrow content-type with charset fails clientRequestValidation
---
 .../rest/RestJettyInvalidContentTypeClientRequestValidationTest.java  | 2 +-
 .../src/main/java/org/apache/camel/processor/RestBindingAdvice.java   | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/rest/RestJettyInvalidContentTypeClientRequestValidationTest.java b/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/rest/RestJettyInvalidContentTypeClientRequestValidationTest.java
index 59dcfcac051..3735095cd40 100644
--- a/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/rest/RestJettyInvalidContentTypeClientRequestValidationTest.java
+++ b/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/rest/RestJettyInvalidContentTypeClientRequestValidationTest.java
@@ -32,7 +32,7 @@ public class RestJettyInvalidContentTypeClientRequestValidationTest extends Base
 
     @Test
     public void testJettyInvalidContentType() {
-        fluentTemplate = fluentTemplate.withHeader(Exchange.CONTENT_TYPE, "application/json")
+        fluentTemplate = fluentTemplate.withHeader(Exchange.CONTENT_TYPE, "application/json; charset=utf-8")
                 .withHeader(Exchange.HTTP_METHOD, "post")
                 .withBody("{\"name\": \"Donald\"}")
                 .to("http://localhost:" + getPort() + "/users/123/update");
diff --git a/core/camel-core-processor/src/main/java/org/apache/camel/processor/RestBindingAdvice.java b/core/camel-core-processor/src/main/java/org/apache/camel/processor/RestBindingAdvice.java
index 3b28db61edd..e4beb3fadd0 100644
--- a/core/camel-core-processor/src/main/java/org/apache/camel/processor/RestBindingAdvice.java
+++ b/core/camel-core-processor/src/main/java/org/apache/camel/processor/RestBindingAdvice.java
@@ -36,6 +36,7 @@ import org.apache.camel.support.MessageHelper;
 import org.apache.camel.support.processor.MarshalProcessor;
 import org.apache.camel.support.processor.UnmarshalProcessor;
 import org.apache.camel.util.ObjectHelper;
+import org.apache.camel.util.StringHelper;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -594,6 +595,9 @@ public class RestBindingAdvice implements CamelInternalProcessorAdvice<Map<Strin
             return true;
         }
 
+        //  content-type is before optional charset
+        target = StringHelper.before(target, ";", target);
+
         valid = valid.toLowerCase(Locale.ENGLISH);
         target = target.toLowerCase(Locale.ENGLISH);