Fix: Added CORS header to REST API to allow cross-domain calls from modern browsers.
diff --git a/src/emuvim/api/rest/network.py b/src/emuvim/api/rest/network.py
index 83fbde7..2745602 100755
--- a/src/emuvim/api/rest/network.py
+++ b/src/emuvim/api/rest/network.py
@@ -39,6 +39,8 @@
logging.basicConfig(level=logging.INFO)
+CORS_HEADER = {'Access-Control-Allow-Origin': '*'}
+
net = None
@@ -98,7 +100,7 @@
cookie=cookie,
priority=priority)
# return setChain response
- return str(c), 200
+ return str(c), 200, CORS_HEADER
except Exception as ex:
logging.exception("API error.")
- return ex.message, 500
\ No newline at end of file
+ return ex.message, 500, CORS_HEADER