Skip to content

Commit c6a789d

Browse files
committed
Fix setting "ended" flag on stream if there is no request body
1 parent d50928e commit c6a789d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Connection/Internal/Http2ConnectionProcessor.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -998,7 +998,12 @@ public function request(Request $request, Cancellation $cancellation, Stream $st
998998
$chunk = $body->read($cancellation);
999999

10001000
$headers = $this->hpack->encode($this->generateHeaders($request));
1001-
$flag = Http2Parser::END_HEADERS | ($chunk === null ? Http2Parser::END_STREAM : Http2Parser::NO_FLAG);
1001+
1002+
$flag = Http2Parser::END_HEADERS;
1003+
if ($chunk === null) {
1004+
$http2stream->ended = true;
1005+
$flag |= Http2Parser::END_STREAM;
1006+
}
10021007

10031008
if (\strlen($headers) > $this->frameSizeLimit) {
10041009
$split = \str_split($headers, $this->frameSizeLimit);

0 commit comments

Comments
 (0)