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 09B14110E7 for ; Mon, 22 Sep 2014 15:57:37 +0000 (UTC) Received: (qmail 33986 invoked by uid 500); 22 Sep 2014 15:57:35 -0000 Delivered-To: apmail-chemistry-dev-archive@chemistry.apache.org Received: (qmail 33937 invoked by uid 500); 22 Sep 2014 15:57:35 -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 33786 invoked by uid 99); 22 Sep 2014 15:57:35 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Sep 2014 15:57:35 +0000 Date: Mon, 22 Sep 2014 15:57:34 +0000 (UTC) From: "Ron Gavlin (JIRA)" 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=3D141433= 36#comment-14143336 ]=20 Ron Gavlin commented on CMIS-844: --------------------------------- You are correct that saving the original stream in the filter is an option = so that OpenCMIS can decode independently of the filter. However, the doubl= e-decoding does introduce overhead and requires changes to existing code th= at formerly worked with the 0.7.0 release. Would you consider defining a co= nfigurable property to optionally enable the functionality provided by the = patch? > 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)