New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"FilterServletResponseWrapper.flushBuffer()" does not flush the response with empty body #836
Comments
fixed by e0c2fe0 and ready for the next release (1.78). |
Thanks for quick reply! |
The fix of this issue (e0c2fe0) caused JENKINS-58419. |
JENKINS-58419 (since monitoring-plugin 1.78) is fixed by 068775a: |
…ush the response with empty body
We use javamelody with tomcat on our product environment. We configure javamelody as the first filter for tomcat webapp. Recently we found an issue that tomcat webapp REST API returns 304 without body, but finally user gets 204.
We did some trouble-shooting and found when tomcat webapp call response.flushBuffer(), it ends up with calling javamelody "FilterServletResponseWrapper.flushBuffer()", its code likes below:
Looks it only flush response when the body(either writer or stream) is not empty, for our case, response without body cannot be flushed from here. Then it reaches jersey library, from there it changes the code to 204 due to empty body.
We think it would be better to change the above code to below:
If no body found just call the wrapped response flushBuffer() to send out the response status code and headers. With the above changes, our user finally got correct response code 304.
The text was updated successfully, but these errors were encountered: