From dev-return-89516-apmail-cocoon-dev-archive=cocoon.apache.org@cocoon.apache.org Mon Sep 11 17:14:50 2006 Return-Path: Delivered-To: apmail-cocoon-dev-archive@www.apache.org Received: (qmail 77300 invoked from network); 11 Sep 2006 17:14:49 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 11 Sep 2006 17:14:49 -0000 Received: (qmail 12189 invoked by uid 500); 11 Sep 2006 17:14:45 -0000 Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 12063 invoked by uid 500); 11 Sep 2006 17:14:45 -0000 Mailing-List: contact dev-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@cocoon.apache.org List-Id: Delivered-To: mailing list dev@cocoon.apache.org Received: (qmail 12052 invoked by uid 99); 11 Sep 2006 17:14:45 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (140.211.166.84) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Sep 2006 10:14:45 -0700 X-ASF-Spam-Status: No, hits=0.0 required=5.0 tests= Received: from ([209.237.227.198:39091] helo=brutus.apache.org) by idunn.apache.osuosl.org (ecelerity 2.1 r(10620)) with ESMTP id 4A/60-25916-E8995054 for ; Mon, 11 Sep 2006 10:14:54 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id A40AD714304 for ; Mon, 11 Sep 2006 17:11:22 +0000 (GMT) Message-ID: <22166464.1157994682642.JavaMail.jira@brutus> Date: Mon, 11 Sep 2006 10:11:22 -0700 (PDT) From: =?utf-8?Q?Tam=C3=A1s_Buresch_=28JIRA=29?= To: dev@cocoon.apache.org Subject: [jira] Created: (COCOON-1917) Request Encoding problem: multipart/form vs. url encoded MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Request Encoding problem: multipart/form vs. url encoded -------------------------------------------------------- Key: COCOON-1917 URL: http://issues.apache.org/jira/browse/COCOON-1917 Project: Cocoon Issue Type: Bug Components: * Cocoon Core Affects Versions: 2.1.8 Reporter: Tam=C3=A1s Buresch Although this bug was found in Cocoon 2.1.6., seems it is still present in = 2.1.8. (by comparing the source files) Request parameters can be url-encoded (GET) or 'multipart/form' encoded (HT= TP POST and form encoding is set to multipart/form). Cocoon decodes them differently, thus there are problems when HTML is encod= ed in UTF-8. Reproducing the bug: Create a simple xsp or action which dumps the request parameters. Set the form encoding to UTF-8 and the container encoding to ISO-8859-1 in = web.xml. container-encoding ISO-8859-1=20 form-encoding utf-8 Use the following HTML fragment. =20
=20 Fill the form with characters having funny accents. Trying POST and GET yields different results. GET works, POST fails. If the container encoding is set to UTF-8, then GET fails but POST works. Here is a simple patch which partially fixes this bug. In org\apache\cocoon\environment\http\HttpEnvironment.java the line: this.request.setContainerEncoding(containerEncoding); should be replaced with: // !!! THIS IS JUST A PARTIAL FIX !!! // The containerEncoding is irrelevant in case of MultipartHttpServ= letRequest. // This fix assumes that the client does not send the encoding info= rmation to=20 // the server in case of multipart/form or it is equals to default= FormEncoding. // // Complete fix would be: // The encoding used in RequestFactory.getServletRequest() is passe= d to MultipartHttpServletRequest // and here that encoding is passed to this.request.setContainerEnc= oding(). // if (req instanceof MultipartHttpServletRequest) { this.request.setContainerEncoding(defaultFormEncoding); } else { this.request.setContainerEncoding(containerEncoding); } --=20 This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: htt= p://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira