Enable CORS for data/* (#1922)
* Test Flask-Cors * Add a CORS test for data/*
This commit is contained in:
Родитель
178d0acb81
Коммит
85faec04ae
|
@ -41,6 +41,7 @@ import django
|
|||
|
||||
from google.auth.transport import requests
|
||||
from flask import session
|
||||
from flask_cors import CORS
|
||||
import sys
|
||||
|
||||
# Initialize django so that it'll function when run as a standalone script.
|
||||
|
@ -515,6 +516,9 @@ def FlaskApplication(import_name, routes, pattern_base='', debug=False):
|
|||
# Flask apps also have a debug setting that can be used to auto-reload
|
||||
# template source code, but we use django for that.
|
||||
|
||||
# Set the CORS HEADERS.
|
||||
CORS(app, resources={r'/data/*': {'origins': '*'}})
|
||||
|
||||
# Set cookie headers in Flask; see
|
||||
# https://flask.palletsprojects.com/en/2.0.x/config/
|
||||
# for more details.
|
||||
|
|
|
@ -16,6 +16,7 @@ requests==2.27.1
|
|||
# TODO(jrobbins): Update to a 2.x version of flask, which may require source
|
||||
# code changes.
|
||||
Flask==1.1.2
|
||||
flask-cors==3.0.10
|
||||
funcsigs==1.0.2
|
||||
Jinja2==2.11.3
|
||||
MarkupSafe==1.1.1
|
||||
|
|
Загрузка…
Ссылка в новой задаче