diff --git a/src/Protocols/Http.php b/src/Protocols/Http.php index 453bd8a3..828d88ea 100644 --- a/src/Protocols/Http.php +++ b/src/Protocols/Http.php @@ -128,7 +128,7 @@ public static function input(string $buffer, TcpConnection $connection): int $connection->end(static::HTTP_431, true); return 0; } - $header = isset($buffer[$length]) ? substr($buffer, 0, $length) : $buffer; + $header = isset($buffer[$length + 1]) ? substr($buffer, 0, $length) : $buffer; if ($length <= TcpConnection::MAX_CACHE_STRING_LENGTH && isset($cache[$header])) { return $cache[$header];