-
Notifications
You must be signed in to change notification settings - Fork 2k
Closed
Labels
BugFor general bugs on Jetty sideFor general bugs on Jetty sideSponsoredThis issue affects a user with a commercial support agreementThis issue affects a user with a commercial support agreement
Description
Jetty version(s)
12.1.0
Jetty Environment
ee8 and ee9
HTTP version
Any
Java version/vendor (use: java -version)
Any
OS type/version
Any
Description
If using the nested.BufferedResponseHandler in ee8/ee9 it is possible to trigger a NPE if the following sequence of events occur.
Note: this is not an issue present in the Jetty Core org.eclipse.jetty.server.handler.BufferedResponseHandler (a different class)
new HttpServlet()
{
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException
{
resp.setStatus(400);
resp.flushBuffer();
resp.getOutputStream().close();
}
}- Don't write response content.
- Set the status code.
- Flush the response buffers.
- Manually close the response outputstream.
This messes up the BufferedResponseHandler internal state tracking if an aggregate buffer has been used or not.
Metadata
Metadata
Assignees
Labels
BugFor general bugs on Jetty sideFor general bugs on Jetty sideSponsoredThis issue affects a user with a commercial support agreementThis issue affects a user with a commercial support agreement