<commit_before><?php
namespace noFlash\CherryHttp;

use Psr\Log\LoggerInterface;

/**
 * Object represents single HTTP request made by client.
 *
 * @package noFlash\CherryHttp
 */
class HttpRequest extends HttpMessage
{
    /** @var integer Maximum URI length */
    const MAX_URI_LENGTH = 2048;
    /** @var integer Max allowed request headers length */
    const MAX_HEADER_LENGTH = 8192; //If you need to mess with this value you have bigger problems than this :D
    /** @var LoggerInterface */
    protected $logger;
    protected $isRequestCollected = false;

    protected $method      = '';
    protected $queryString = '';
    protected $uri         = '';

    /**
     * @param string $headers HTTP request headers (along with status line)
     * @param LoggerInterface $logger
     *
     * @throws HttpException
     */
    public function __construct($headers, LoggerInterface $logger)
    {
        $this->logger = $logger;
        $this->parseHeader($headers);
    }

    /**<commit_msg>Extended allowed headers size from 8KB to 16KB.<commit_after><?php
namespace noFlash\CherryHttp;

use Psr\Log\LoggerInterface;

/**
 * Object represents single HTTP request made by client.
 *
 * @package noFlash\CherryHttp
 */
class HttpRequest extends HttpMessage
{
    /** @var integer Maximum URI length */
    const MAX_URI_LENGTH = 2048;
    /** @var integer Max allowed request headers length */
    const MAX_HEADER_LENGTH = 16384; //If you need to mess with this value you have bigger problems than this :D
    /** @var LoggerInterface */
    protected $logger;
    protected $isRequestCollected = false;

    protected $method      = '';
    protected $queryString = '';
    protected $uri         = '';

    /**
     * @param string $headers HTTP request headers (along with status line)
     * @param LoggerInterface $logger
     *
     * @throws HttpException
     */
    public function __construct($headers, LoggerInterface $logger)
    {
        $this->logger = $logger;
        $this->parseHeader($headers);
    }

    /**
{'fraction_non_alphanumeric': 0.10436060754532092, 'fraction_numerical': 0.009799118079372856, 'mean_word_length': 2.8455743879472695, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1833224', 'n_tokens_mistral': 573, 'n_tokens_neox': 533, 'n_words': 183}