@classmethod
def is_valid_header(cls, name, value=None):
    """Check whether the field name, and optionally the value, make
        a valid HTTP header.
        """
    valid_name = name and name.lower() not in cls._reserved_headers and bool(
        cls._valid_header_re.match(name))
    valid_value = not cls._disallowed_control_codes_re.search(value
        ) if value else True
    return valid_name & valid_value
