-
Bug
-
Resolution: Done
-
Major
-
2.0.13.Final
-
None
HTTP/2 HEAD responses include a body.
If HTTP/2 is enabled in the Undertow server and the client also supports HTTP/2, and the client makes a HEAD request, the response from the server will include a body. As I understand it, HEAD responses should not include a body. https://tools.ietf.org/html/rfc7231#section-4.3.2
If HTTP/2 is not enabled on the server or the client does not support HTTP/2, then the responses to HEAD do not include bodies, which is the desired behavior.
I notice in HttpServerConnection.getSinkConduit, it calls HttpTransferEncoding.createSinkConduit, and that second method has code related to HEAD requests:
Meanwhile in Http2ServerConnection.getSinkConduit, there seems to be no HEAD-related code:
Maybe that is the issue? That the code in Undertow that ensures HEAD responses are empty is in the HTTP 1.x code path but missing from the HTTP/2 code path?