diff --git a/cloud-functions/python/functions/performance/main.py b/cloud-functions/python/functions/performance/main.py index e528f14..e83663e 100644 --- a/cloud-functions/python/functions/performance/main.py +++ b/cloud-functions/python/functions/performance/main.py @@ -9,7 +9,7 @@ import sys import platform import os import io -from flask import send_file +from flask import make_response, send_file from datetime import datetime import re import xlsxwriter @@ -33,8 +33,8 @@ def performance(request): if request.method == 'OPTIONS': headers = { 'Access-Control-Allow-Origin': '*', - 'Access-Control-Allow-Methods': 'GET', - 'Access-Control-Allow-Headers': 'Content-Type', + 'Access-Control-Allow-Methods': 'GET, POST', + # 'Access-Control-Allow-Headers': '*', # 'Access-Control-Max-Age': '3600' } @@ -320,4 +320,5 @@ def performance(request): file_data = io.BytesIO(f.read()) # application/vnd.ms-excel - return send_file(file_data, download_name= output_filename, mimetype="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet") \ No newline at end of file + response = make_response(send_file(file_data, download_name= output_filename, mimetype="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"), 200, headers) + return response \ No newline at end of file