You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ni...@apache.org on 2014/10/09 10:15:53 UTC
[5/7] git commit: CAMEL-7886 Fixed the ContentType charset setting
issue of camel-http4
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/2bcac18c
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/2bcac18c
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/2bcac18c
Branch: refs/heads/camel-2.14.x
Commit: 2bcac18c8c30bc2a8248293d164df885b1f929b1
Parents: 48fa5e3
Author: Willem Jiang <wi...@gmail.com>
Authored: Thu Oct 9 16:11:17 2014 +0800
Committer: Willem Jiang <wi...@gmail.com>
Committed: Thu Oct 9 16:14:52 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/2bcac18c/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 2fb8380..d41dbe1 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
@@ -412,7 +412,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)) {