Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
Engine 2.2.10
-
None
Description
The SlingRequestDispatcher#forward call [0] attempts to close the response buffer even if this has already been closed by the servlet to which the request was originally forwarded. The Servlet Specification [1] mentions the following in section 9.4:
Before the forward method of the RequestDispatcher interface returns without exception, the response content must be sent and committed, and closed by the servlet container, unless the request was put into the asynchronous mode.
As such, the RequestDispatcher#forward implementation should indeed make sure the response is committed, but it's not necessarily the only one that must commit the response. Jetty seems to have the same understanding [2], where the close is performed only if the response hasn't already been committed and the request is not async.
[1] - https://download.oracle.com/otn-pub/jcp/servlet-3_1-fr-spec/servlet-3_1-final.pdf
Attachments
Issue Links
- is related to
-
SLING-11458 Regress - "Writer has already been closed" exception in GraphQLServlet
- Closed
- relates to
-
SLING-2724 Error handling doesn't respect servlet spec
- Closed
- links to