Return-Path: X-Original-To: apmail-chemistry-dev-archive@www.apache.org Delivered-To: apmail-chemistry-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0D84B11238 for ; Sat, 20 Sep 2014 22:35:34 +0000 (UTC) Received: (qmail 72879 invoked by uid 500); 20 Sep 2014 22:35:33 -0000 Delivered-To: apmail-chemistry-dev-archive@chemistry.apache.org Received: (qmail 72818 invoked by uid 500); 20 Sep 2014 22:35:33 -0000 Mailing-List: contact dev-help@chemistry.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@chemistry.apache.org Delivered-To: mailing list dev@chemistry.apache.org Received: (qmail 72807 invoked by uid 99); 20 Sep 2014 22:35:33 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 20 Sep 2014 22:35:33 +0000 Date: Sat, 20 Sep 2014 22:35:33 +0000 (UTC) From: =?utf-8?Q?Florian_M=C3=BCller_=28JIRA=29?= To: dev@chemistry.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CMIS-844) POSTHttpServletRequestWrapper should accommodate prior consumption of request body by a filter MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CMIS-844?page=3Dcom.atlassian.j= ira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D141422= 20#comment-14142220 ]=20 Florian M=C3=BCller commented on CMIS-844: ------------------------------------- This has been changed for a reason. Most servlet engines use ISO-8859-1 to = decode the values. Newer RFCs recommend UTF-8 and that makes a lot of sense= for CMIS. For example, creating a folder with a Chinese name requires a ch= arset that has Chinese characters. ISO-8859-1 is too limited. That=E2=80=99= s why OpenCMIS does all the decoding and doesn't leave it to the servlet en= gine. If you use request.getParameterMap() in filter, you are back to ISO-8859-1.= The code change that you have proposed would give you inconsistent results= =E2=80=93 depending on whether you have called request.getParameterMap() i= n filter or not. I=E2=80=99ll look into it, but I=E2=80=99m not sure that there is a good so= lution. > POSTHttpServletRequestWrapper should accommodate prior consumption of req= uest body by a filter > -------------------------------------------------------------------------= --------------------- > > Key: CMIS-844 > URL: https://issues.apache.org/jira/browse/CMIS-844 > Project: Chemistry > Issue Type: Bug > Components: opencmis-server > Affects Versions: OpenCMIS 0.12.0 > Reporter: Ron Gavlin > Assignee: Florian M=C3=BCller > > POSTHttpServletRequestWrapper should accommodate prior consumption of the= request body by a filter. > The 0.7.0 release provided this accommodation. This appears to have been = broken by the major post-0.7.0 refactoring. > The following POSTHttpServletRequestWrapper constructor modification fixe= s the problem: > {code} > ... > if (isMultipart) { > ... > } else { > // form data processing > StringBuilder sb =3D new StringBuilder(); > InputStreamReader sr =3D new InputStreamReader(request.getInp= utStream(), IOUtils.UTF8); > char[] buffer =3D new char[4096]; > int c =3D 0; > while ((c =3D sr.read(buffer)) > -1) { > sb.append(buffer, 0, c); > } > if (sb.length() < 3) { > @SuppressWarnings("unchecked") > Map parameterMap =3D request.getParamet= erMap(); > getParameterMap().putAll(parameterMap); > } else { > parseFormData(sb.toString()); > } > } > ... > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)