Open markt-asf opened 9 months ago
Note that eclipse jetty has had a proprietary extension to sendError
for some time to support 102 Processing and now 103 Early Hints. We also treat -1 specially as a request to abort/reset the response. This is useful for trying to communicate failure when an error has been detected, but the response is already committed.
I think a sendInformationalStatus(int)
method would be fine... although we probably would need to block 101, as that has other implications beyond what can be done in a servlet. Perhaps an abort()
method to cover the -1 case above?
By abort()
do you mean close the connection?
This issue arose from discussions around dropping HTTP/2 push support in #538.
Do we reuse
sendError()
, introduce a new method or something else?Given the Javadoc for
sendError()
, I think a new method (name?) would be better.Given the number of different methods that can set status codes, I think we should also add a requirement to throw
IllegalArgumentException
if any such method is used with an inappropriate status code (e.g. a 4xx code withsendRedirect
)