Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-dev] non-destructive request body read


Note that there is another trick you can do.  You can consume and buffer all the content and then pop it back onto the input queue.
An example of this was done for a jetty-9.3 request inflater class: https://github.com/eclipse/jetty.project/blob/jetty-9.3.x/jetty-server/src/main/java/org/eclipse/jetty/server/handler/gzip/GzipRequestCustomizer.java

Of course buffering requests means that you are vulnerable to DOS attacks, so not generally a good thing.

cheers





On Tue, 17 Sep 2019 at 05:38, Raymond Auge <raymond.auge@xxxxxxxxxxx> wrote:
Thanks Joakim,

that's handy for the future.

- Ray

On Mon, Sep 16, 2019 at 3:26 PM Joakim Erdfelt <joakim@xxxxxxxxxxx> wrote:
The classes that could handle this are HttpInput.Interceptor and HttpOutput.Interceptor

Joakim Erdfelt / joakim@xxxxxxxxxxx


On Mon, Sep 16, 2019 at 1:42 PM Raymond Auge <raymond.auge@xxxxxxxxxxx> wrote:
Is there some trick I could use to read request body in a non-destructive way (for debugging purposes)? I want to dump the request body in a log.

I've got an implementation of org.eclipse.jetty.server.RequestLog going already but I would like to dump the request body which is tricky as you know.

--
Raymond Augé (@rotty3000)
Senior Software Architect Liferay, Inc. (@Liferay)
_______________________________________________
jetty-dev mailing list
jetty-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/jetty-dev
_______________________________________________
jetty-dev mailing list
jetty-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/jetty-dev


--
Raymond Augé (@rotty3000)
Senior Software Architect Liferay, Inc. (@Liferay)
_______________________________________________
jetty-dev mailing list
jetty-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/jetty-dev


--

Back to the top