You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@chemistry.apache.org by Florent Guillaume <fg...@nuxeo.com> on 2014/09/22 15:36:32 UTC

POSTHttpServletRequestWrapper parameters

Hi,

When POSTHttpServletRequestWrapper is invoked, it reads all the
parameters from a POST body into its own parameter map
(QueryStringHttpServletRequestWrapper), by consuming and parsing the
input stream.

However in our implementation the input stream was already read and
parsed by a previous filter that needed to consult the request
parameters through a call to request.getParameter().

I suggest that POSTHttpServletRequestWrapper should allow for a
previous filter having already parsed the request parameters and
consumed the body, by at least delegating to super for the initial
acquisition of its parameter map, in
QueryStringHttpServletRequestWrapper.

What do you think? I can provide a patch if needed.

(As has been pointed out to me, in theory the previous filter
could/should have wrapped the whole request to cache and return the
body, but here we're dealing with multipart/form-data and the body has
been turned into a parameter map and is still available in another
format.)

Florent

-- 
Florent Guillaume, Director of R&D, Nuxeo
Open Source Content Management Platform for Business Apps
http://www.nuxeo.com   http://community.nuxeo.com

Re: POSTHttpServletRequestWrapper parameters

Posted by Florent Guillaume <fg...@nuxeo.com>.
Sorry, I hadn't seen that Ron had already created
https://issues.apache.org/jira/browse/CMIS-844.

Florent

On Mon, Sep 22, 2014 at 3:36 PM, Florent Guillaume <fg...@nuxeo.com> wrote:
> Hi,
>
> When POSTHttpServletRequestWrapper is invoked, it reads all the
> parameters from a POST body into its own parameter map
> (QueryStringHttpServletRequestWrapper), by consuming and parsing the
> input stream.
>
> However in our implementation the input stream was already read and
> parsed by a previous filter that needed to consult the request
> parameters through a call to request.getParameter().
>
> I suggest that POSTHttpServletRequestWrapper should allow for a
> previous filter having already parsed the request parameters and
> consumed the body, by at least delegating to super for the initial
> acquisition of its parameter map, in
> QueryStringHttpServletRequestWrapper.
>
> What do you think? I can provide a patch if needed.
>
> (As has been pointed out to me, in theory the previous filter
> could/should have wrapped the whole request to cache and return the
> body, but here we're dealing with multipart/form-data and the body has
> been turned into a parameter map and is still available in another
> format.)
>
> Florent
>
> --
> Florent Guillaume, Director of R&D, Nuxeo
> Open Source Content Management Platform for Business Apps
> http://www.nuxeo.com   http://community.nuxeo.com



-- 
Florent Guillaume, Director of R&D, Nuxeo
Open Source Content Management Platform for Business Apps
http://www.nuxeo.com   http://community.nuxeo.com