From 20932318fb460030cecd9030214ac401ad64ab72 Mon Sep 17 00:00:00 2001 From: Dakota Nelson Date: Mon, 1 Jan 2018 16:19:24 -0700 Subject: [PATCH] add CORS * header to all REST api responses --- empire | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/empire b/empire index deb9349..6b719e2 100755 --- a/empire +++ b/empire @@ -223,6 +223,11 @@ def start_restful_api(empireMenu, suppress=False, username=None, password=None, if (token != apiToken) and (token != permanentApiToken): return make_response('', 401) + @app.after_request + def add_cors(response): + response.headers['Access-Control-Allow-Origin'] = '*' + return response + @app.errorhandler(Exception) def exception_handler(error):