Return-Path: Delivered-To: apmail-synapse-dev-archive@www.apache.org Received: (qmail 43347 invoked from network); 20 Sep 2010 05:34:58 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 20 Sep 2010 05:34:58 -0000 Received: (qmail 9742 invoked by uid 500); 20 Sep 2010 05:34:58 -0000 Delivered-To: apmail-synapse-dev-archive@synapse.apache.org Received: (qmail 9565 invoked by uid 500); 20 Sep 2010 05:34:57 -0000 Mailing-List: contact dev-help@synapse.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@synapse.apache.org Delivered-To: mailing list dev@synapse.apache.org Received: (qmail 9557 invoked by uid 99); 20 Sep 2010 05:34:56 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Sep 2010 05:34:56 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Sep 2010 05:34:54 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o8K5YXRQ001480 for ; Mon, 20 Sep 2010 05:34:33 GMT Message-ID: <2507624.288851284960873200.JavaMail.jira@thor> Date: Mon, 20 Sep 2010 01:34:33 -0400 (EDT) From: "Hiranya Jayathilaka (JIRA)" To: dev@synapse.apache.org Subject: [jira] Resolved: (SYNAPSE-662) ClientWorker overriding character encoding In-Reply-To: <29696640.7681276110080820.JavaMail.jira@thor> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/SYNAPSE-662?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Hiranya Jayathilaka resolved SYNAPSE-662. ----------------------------------------- Fix Version/s: 2.0 Resolution: Fixed Checked in the patch to the trunk > ClientWorker overriding character encoding > ------------------------------------------ > > Key: SYNAPSE-662 > URL: https://issues.apache.org/jira/browse/SYNAPSE-662 > Project: Synapse > Issue Type: Bug > Affects Versions: 1.2 > Reporter: Myles Bunbury > Assignee: Hiranya Jayathilaka > Fix For: 2.0 > > Attachments: SYNAPSE-662-patch.txt > > > The following code exists in the org.apache.synapse.transport.nhttp.ClientWorker class' run() method: > responseMsgCtx.setProperty( > Constants.Configuration.CHARACTER_SET_ENCODING, > contentType.indexOf(HTTP.CHARSET_PARAM) > 0 ? > charSetEnc : MessageContext.DEFAULT_CHAR_SET_ENCODING); > This fails however for the following Content-Type HTTP header: > application/soap+xml; action="urn:echoResponse";charset=UTF-16 > BuilderUtil.getCharSetEncoding(contentType) is called a few lines up and correctly extracts the UTF-16 character set value, but then overrides this and sets it to UTF-8. It does this because the value of org.apache.http.protocol.HTTP.CHARSET_PARAM is "; charset=". That is, it's failing because the response does not have a space between the charset parameter and the previous parameter. > Reading through the HTTP specs, I haven't come across anything that says either that whitespace is permissible or not permissible here. In my view the code should therfore be flexible enough to handle either case. > I would suggest simpifying the code to: > responseMsgCtx.setProperty(Constants.Configuration.CHARACTER_SET_ENCODING, charSetEnc); > as the BuilderUtil.getCharSetEncoding() code above the offending code seems to be sufficient at first glance. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org For additional commands, e-mail: dev-help@synapse.apache.org