From 410c704f5a0cfeff2427e7ba5a9a6f6a27ec6ef1 Mon Sep 17 00:00:00 2001 From: Aaron Piotrowski Date: Thu, 17 Nov 2022 18:55:50 -0600 Subject: [PATCH] Fix HEAD requests in HTTP/2 --- src/Connection/Internal/Http2ConnectionProcessor.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Connection/Internal/Http2ConnectionProcessor.php b/src/Connection/Internal/Http2ConnectionProcessor.php index 9effa3fb..7542f026 100644 --- a/src/Connection/Internal/Http2ConnectionProcessor.php +++ b/src/Connection/Internal/Http2ConnectionProcessor.php @@ -488,7 +488,9 @@ public function handleHeaders(int $streamId, array $pseudo, array $headers, bool return; } - $stream->expectedLength = (int) $contentLength; + if ($stream->request->getMethod() !== 'HEAD') { + $stream->expectedLength = (int)$contentLength; + } } }