Add CORS support for reverse web proxies

pull/998/head
kx1t 2025-04-09 11:11:59 -04:00 zatwierdzone przez GitHub
rodzic 8b6e2f25be
commit 9ce9de3a33
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B5690EEEBB952194
2 zmienionych plików z 5 dodań i 2 usunięć

Wyświetl plik

@ -38,6 +38,7 @@ from queue import Queue
from threading import Thread
import flask
from flask import request, abort, make_response, send_file
from flask_cors import CORS
from flask_socketio import SocketIO
from werkzeug.middleware.proxy_fix import ProxyFix
@ -56,9 +57,10 @@ app.jinja_env.auto_reload = True
flask_app_thread = None
# A key that needs to be matched to allow shutdown.
flask_shutdown_key = None
# allow all CORS:
cors = CORS(app, resources={r"/*": {"origins": "*"}})
# SocketIO instance
socketio = SocketIO(app, async_mode="threading")
socketio = SocketIO(app, async_mode="threading", cors_allowed_origins="*")
# Global store of telemetry data, which we will add data to and manage.
# Under each key (which will be the sonde ID), we will have a dictionary containing:

Wyświetl plik

@ -1,6 +1,7 @@
python-dateutil
flask
flask-socketio
flask-cors
numpy
requests
semver