Re: [Bug 47410] Using Request#getStream() while reading parameters

2017-09-21 Thread Volkan Yazıcı
Hrm... Now I see it. That is an unfortunate outcome of deep nesting. Anyway... So there are two solutions proposed so far: 1) Reconstruct payload from parameters [me] and 2) use ServletFileUpload to persist+reinstantiate the request [Igal]. Both of them are nasty hacks with their own shortcomings.

Re: [Bug 47410] Using Request#getStream() while reading parameters

2017-09-21 Thread Mark Thomas
On 21/09/17 22:33, Volkan Yazıcı wrote: > Would you mind elaborating your answer? I just want, > in org.apache.catalina.connector.Request, readPostBody() method to access > the request stream via getInputStream() rather than getStream(). Maybe I am > missing something but this looks legit to me. T

Re: [Bug 47410] Using Request#getStream() while reading parameters

2017-09-21 Thread Volkan Yazıcı
Would you mind elaborating your answer? I just want, in org.apache.catalina.connector.Request, readPostBody() method to access the request stream via getInputStream() rather than getStream(). Maybe I am missing something but this looks legit to me. On Thu, Sep 21, 2017 at 11:13 PM, Mark Thomas wr

Re: [Bug 47410] Using Request#getStream() while reading parameters

2017-09-21 Thread Mark Thomas
On 21/09/17 21:58, Volkan Yazıcı wrote: > Hey Igal, > > Today, I've tried to implement your proposal (consuming the InputStream > eagerly, wrapping the consumed byte[] as a re-consumable > ServletInputStream, and passing it to next filter) and hit by the same > Tomcat shortcoming: Since you've alr

Re: [Bug 47410] Using Request#getStream() while reading parameters

2017-09-21 Thread Volkan Yazıcı
Hey Igal, Today, I've tried to implement your proposal (consuming the InputStream eagerly, wrapping the consumed byte[] as a re-consumable ServletInputStream, and passing it to next filter) and hit by the same Tomcat shortcoming: Since you've already consumed the original InputStream, later on, an

Re: [Bug 47410] Using Request#getStream() while reading parameters

2017-09-19 Thread Igal @ Lucee.org
Volkan, On 9/19/2017 11:21 AM, Volkan Yazıcı wrote: Hey Igal, Thanks for the response! I believe having more people suffering from the same limitation makes it more clear that there is a shortcoming that needs to addressed in Tomcat. The problem is that Tomcat is compliant with the Servlet sp

Re: [Bug 47410] Using Request#getStream() while reading parameters

2017-09-19 Thread Igal @ Lucee.org
Volkan, On 9/19/2017 10:47 AM, Volkan Yazıcı wrote: Did not try (or consider) using a Tomcat Valve, since it would make the entire tool Tomcat-specific. I would rather find a way to solve the problem in a container agnostic way. I had a similar issue so I wrote a simple Filter and named it "Rer

Re: [Bug 47410] Using Request#getStream() while reading parameters

2017-09-19 Thread Volkan Yazıcı
Hey Christopher, Did not try (or consider) using a Tomcat Valve, since it would make the entire tool Tomcat-specific. I would rather find a way to solve the problem in a container agnostic way. Though, thanks for the idea. Maybe I can release a separate artifact just for Tomcat. Best. On Tue, Se

Re: [Bug 47410] Using Request#getStream() while reading parameters

2017-09-19 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Volkan, On 9/19/17 3:07 AM, Volkan Yazıcı wrote: > Hello, > > When you try to access the raw InputStream of a > x-www-form-urlencoded servlet request, the stream could have > already been indirectly consumed by a prior access to the > parameters (e