Skip to content

Commit

Permalink
Merge pull request from GHSA-qjfw-cvjf-f4fm
Browse files Browse the repository at this point in the history
  • Loading branch information
kelunik authored Apr 3, 2024
1 parent a19f480 commit 881cc33
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Http2/Http2Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,15 @@ private function pushHeaderBlockFragment(int $streamId, string $buffer): void
$this->headerStream = $streamId;
$this->headerBuffer[] = $buffer;
$this->headerLength += \strlen($buffer);

$headersTooLarge = $this->headerLength > $this->headerSizeLimit;

if ($headersTooLarge) {
throw new Http2ConnectionException(
"Headers exceed the maximum configured size of {$this->headerSizeLimit} bytes",
self::COMPRESSION_ERROR
);
}
}

/** @see https://http2.github.io/http2-spec/#HEADERS */
Expand Down

0 comments on commit 881cc33

Please sign in to comment.