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 7278D17231 for ; Thu, 9 Oct 2014 08:15:50 +0000 (UTC) Received: (qmail 96265 invoked by uid 500); 9 Oct 2014 08:15:50 -0000 Delivered-To: apmail-camel-commits-archive@camel.apache.org Received: (qmail 96131 invoked by uid 500); 9 Oct 2014 08:15:50 -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 96111 invoked by uid 99); 9 Oct 2014 08:15:50 -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 93D3799577A; 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:55 -0000 Message-Id: <5bfb61c0e77847e0b892fe945750c688@git.apache.org> In-Reply-To: <1cb0090cd5c14e1294244397141ac3d9@git.apache.org> References: <1cb0090cd5c14e1294244397141ac3d9@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [7/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/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 Authored: Thu Oct 9 16:11:17 2014 +0800 Committer: Willem Jiang 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)) {