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

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


The following commit(s) were added to refs/heads/master by this push:
     new dcfcec8  CAMEL-12424: Fixed set charset from content-type if there are 
values after it. Thanks to Fabricio Guimarães Pellegrini for the patch.
dcfcec8 is described below

commit dcfcec85b3e65ca2068a5563aada70f3bab814ad
Author: Claus Ibsen <claus.ib...@gmail.com>
AuthorDate: Fri Apr 13 09:00:57 2018 +0200

    CAMEL-12424: Fixed set charset from content-type if there are values after 
it. Thanks to Fabricio Guimarães Pellegrini for the patch.
---
 .../src/main/java/org/apache/camel/http/common/HttpHelper.java      | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git 
a/components/camel-http-common/src/main/java/org/apache/camel/http/common/HttpHelper.java
 
b/components/camel-http-common/src/main/java/org/apache/camel/http/common/HttpHelper.java
index 641b0bc..da644dd 100644
--- 
a/components/camel-http-common/src/main/java/org/apache/camel/http/common/HttpHelper.java
+++ 
b/components/camel-http-common/src/main/java/org/apache/camel/http/common/HttpHelper.java
@@ -90,10 +90,8 @@ public final class HttpHelper {
     @SuppressWarnings("deprecation")
     public static void setCharsetFromContentType(String contentType, Exchange 
exchange) {
         if (contentType != null) {
-            // find the charset and set it to the Exchange
-            int index = contentType.indexOf("charset=");
-            if (index > 0) {
-                String charset = contentType.substring(index + 8);
+            String charset = getCharsetFromContentType(contentType);
+            if (charset != null) {
                 exchange.setProperty(Exchange.CHARSET_NAME, 
IOConverter.normalizeCharset(charset));
             }
         }

-- 
To stop receiving notification emails like this one, please contact
davscl...@apache.org.

Reply via email to