def parse_header(line):
    """
    Parse the header into a name-value.
    """
    parts = line.split(b':', 1)

    if len(parts) == 2:
        return parts[0].lower().strip().decode('ascii'), parts[1].strip()

    else:
        raise ValueError("Invalid header: %r" % line)