def build_header(name, value):
    """
    Takes a header name and value and constructs a valid string to add to the headers list.
    """
    stripped_value = value.lstrip(" ").rstrip("\r\n").rstrip("\n")
    stripped_name = name.rstrip(":")
    return f"{stripped_name}: {stripped_value}\r\n"