Return-Path: X-Original-To: apmail-camel-commits-archive@www.apache.org Delivered-To: apmail-camel-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 248CE1722B for ; Thu, 9 Oct 2014 08:15:50 +0000 (UTC) Received: (qmail 95870 invoked by uid 500); 9 Oct 2014 08:15:49 -0000 Delivered-To: apmail-camel-commits-archive@camel.apache.org Received: (qmail 95731 invoked by uid 500); 9 Oct 2014 08:15:49 -0000 Mailing-List: contact commits-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list commits@camel.apache.org Received: (qmail 95614 invoked by uid 99); 9 Oct 2014 08:15:49 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Oct 2014 08:15:49 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 88F11995776; Thu, 9 Oct 2014 08:15:49 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: ningjiang@apache.org To: commits@camel.apache.org Date: Thu, 09 Oct 2014 08:15:53 -0000 Message-Id: <2762cf5ee723444782b6ae7dce93e724@git.apache.org> In-Reply-To: <1cb0090cd5c14e1294244397141ac3d9@git.apache.org> References: <1cb0090cd5c14e1294244397141ac3d9@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [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 Authored: Thu Oct 9 16:11:17 2014 +0800 Committer: Willem Jiang 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)) {