private function validateProtocol($version)
    {
        $valid = [
            '1.0' => true,
            '1.1' => true,
            '2.0' => true,
        ];

        if (!isset($valid[$version])) {
            throw new InvalidArgumentException('Invalid HTTP version. Must be one of: 1.0, 1.1, 2.0');
        }
    }