Filtering the request body in resteasy reactive #29828
-
Hello folks, In my organization we try to implement a request body filtering and logging for all the requests invoked towards our microservices. What we have made so far is:
It works smoothly when request bodies are present in the request, but when we try to fire a GET method with no request body, the Future that vert.x returns from invoking httpServerRequest.body(), can't be completed. So we would like to find a workaround, to filter if the body is empty or not, because if httpServerRequest.body() has no payload, on complete method will never be triggered. The current state of the code looks like this:
`private boolean printPayload(String httpMethod) {
Let's include also, that this feature is going to be a common library for all our endpoints, so we need something magic that plays everywhere. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
/cc @FroMage, @geoand, @stuartwdouglas |
Beta Was this translation helpful? Give feedback.
-
Finally, an answer to this is to retrieve the http header "Content-Length" and check if it's greater than 0 |
Beta Was this translation helpful? Give feedback.
Finally, an answer to this is to retrieve the http header "Content-Length" and check if it's greater than 0