fix cors for pref
This commit is contained in:
@@ -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")
|
||||
response = make_response(send_file(file_data, download_name= output_filename, mimetype="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"), 200, headers)
|
||||
return response
|
||||
Reference in New Issue
Block a user