fix cors for pref
This commit is contained in:
@@ -9,7 +9,7 @@ import sys
|
|||||||
import platform
|
import platform
|
||||||
import os
|
import os
|
||||||
import io
|
import io
|
||||||
from flask import send_file
|
from flask import make_response, send_file
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
import re
|
import re
|
||||||
import xlsxwriter
|
import xlsxwriter
|
||||||
@@ -33,8 +33,8 @@ def performance(request):
|
|||||||
if request.method == 'OPTIONS':
|
if request.method == 'OPTIONS':
|
||||||
headers = {
|
headers = {
|
||||||
'Access-Control-Allow-Origin': '*',
|
'Access-Control-Allow-Origin': '*',
|
||||||
'Access-Control-Allow-Methods': 'GET',
|
'Access-Control-Allow-Methods': 'GET, POST',
|
||||||
'Access-Control-Allow-Headers': 'Content-Type',
|
# 'Access-Control-Allow-Headers': '*',
|
||||||
# 'Access-Control-Max-Age': '3600'
|
# 'Access-Control-Max-Age': '3600'
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -320,4 +320,5 @@ def performance(request):
|
|||||||
file_data = io.BytesIO(f.read())
|
file_data = io.BytesIO(f.read())
|
||||||
|
|
||||||
# application/vnd.ms-excel
|
# 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