Closed pengye91 closed 1 month ago
I imagine we should have a request_body_filter
like response_body_filter
to be able to handle this.
Nowadays, is there a momentary solution to read the request body without consuming it?
Note that request_body_filter
was added in f38f3b9a38cae13e116f868ef23e977252dc24a2 which should allow inspecting (or mutating) the body just before sending it to the upstream.
This should fit your mentioned use case of logging the request body, so I will close, but feel free to reopen or open a new issue if you have another use case in mind. Thanks!
What is the problem your feature solves, or the need it fulfills?
currently we can't get the request body in any methods without consuming it.
we can use
read_request_body()
method on thesession
but it will consume the body causing the upstream get aNone
for the request body, which is not we wanted.I think this is a common case for a proxy, for example, to log the request body.
Describe the solution you'd like
I'd like to get the request body in the
request_filter
orupstream_request_filter
phase without consuming it.