From bb63f07ff0b42410ba65cbf1a36dcb986d0f2c64 Mon Sep 17 00:00:00 2001 From: Oleg Kalnichevski Date: Fri, 3 Jan 2025 15:48:06 +0100 Subject: [PATCH] Minor performance optimization in handling of HEAD requests by the H2 transport --- .../apache/hc/core5/http2/impl/nio/ServerH2StreamHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;