def capitalize_header(key):
    """ Returns a capitalized version of the header line such as
    'content-type' -> 'Content-Type'.
    """
    return "-".join([
        item if item[0].isupper() else item[0].upper() + item[1:]
        for item in key.split("-")
    ])