camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject [7/7] git commit: CAMEL-7886 Fixed the ContentType charset setting issue of camel-http4
Date Thu, 09 Oct 2014 08:15:55 GMT
CAMEL-7886 Fixed the ContentType charset setting issue of camel-http4


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/ced67f41
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/ced67f41
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/ced67f41

Branch: refs/heads/camel-2.12.x
Commit: ced67f412ef983cd47093c63043a3691a80ba423
Parents: 92a8793
Author: Willem Jiang <willem.jiang@gmail.com>
Authored: Thu Oct 9 16:11:17 2014 +0800
Committer: Willem Jiang <willem.jiang@gmail.com>
Committed: Thu Oct 9 16:15:15 2014 +0800

----------------------------------------------------------------------
 .../java/org/apache/camel/component/http4/HttpProducer.java   | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/ced67f41/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpProducer.java
----------------------------------------------------------------------
diff --git a/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpProducer.java
b/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpProducer.java
index e2b09d4..f6dc656 100644
--- a/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpProducer.java
+++ b/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpProducer.java
@@ -416,7 +416,12 @@ public class HttpProducer extends DefaultProducer {
                     //When ContentType.parse parse method parse "multipart/form-data;boundary=---------------------------j2radvtrk",
                     //it removes "boundary" from Content-Type; I have to use contentType.create
method.
                     if (contentTypeString != null) {
-                        contentType = ContentType.create(contentTypeString);
+                        // using ContentType.parser for charset 
+                        if (contentTypeString.indexOf("charset") > 0) {
+                            contentType = ContentType.parse(contentTypeString);
+                        } else {
+                            contentType = ContentType.create(contentTypeString);
+                        }
                     }
                                         
                     if (contentTypeString != null && HttpConstants.CONTENT_TYPE_JAVA_SERIALIZED_OBJECT.equals(contentTypeString))
{


Mime
View raw message