Enable CORS from everywhere using flask-cors. (#3316)

Co-authored-by: Leo Sutic <leo.sutic@matterport.com>
This commit is contained in:
Leo Sutic 2020-09-19 11:07:17 +02:00 committed by GitHub
commit cc0bd5213f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 32 additions and 1 deletions

View file

@ -9,6 +9,7 @@ from threading import Lock
import six
from flask import Flask
from flask_cors import CORS
from flask.testing import FlaskClient
from six.moves.urllib.parse import urlencode
@ -205,6 +206,7 @@ def create_backend_app(service):
backend_app = Flask(__name__)
backend_app.debug = True
backend_app.service = service
CORS(backend_app)
# Reset view functions to reset the app
backend_app.view_functions = {}