def make_csv_response(csv_data, filename):
    """
    :param csv_data: A string with the contents of a csv file in it
    :param filename: The filename that the file will be saved as when it is downloaded by the user
    :return: The response to return to the web connection
    """
    resp = make_response(csv_data)
    resp.headers['Content-Type'] = 'application/octet-stream'
    resp.headers['Content-Disposition'] = 'attachment; filename=%s' % filename

    return resp
:param csv_data: A string with the contents of a csv file in it
    :param filename: The filename that the file will be saved as when it is downloaded by the user
    :return: The response to return to the web connection