diff --git a/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/ServerH2StreamHandler.java b/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/ServerH2StreamHandler.java index 508702508..eaf53a7ac 100644 --- a/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/ServerH2StreamHandler.java +++ b/httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/ServerH2StreamHandler.java @@ -179,7 +179,7 @@ private void commitResponse( receivedRequest != null && Method.HEAD.isSame(receivedRequest.getMethod()); outputChannel.submit(responseHeaders, endStream); connMetrics.incrementResponseCount(); - if (responseEntityDetails == null) { + if (endStream) { responseState = MessageState.COMPLETE; } else { responseState = MessageState.BODY;