From bddef3e241ef9d7a701d8183da21f19281fdbab2 Mon Sep 17 00:00:00 2001 From: "ljf (zamentur)" Date: Sat, 6 Aug 2022 23:20:14 +0200 Subject: [PATCH] [enh] Remove unworking CORS headers --- moulinette/interfaces/api.py | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/moulinette/interfaces/api.py b/moulinette/interfaces/api.py index 04624b27..08af47d5 100644 --- a/moulinette/interfaces/api.py +++ b/moulinette/interfaces/api.py @@ -727,12 +727,6 @@ class Interface: # TODO: Return OK to 'OPTIONS' xhr requests (l173) app = Bottle(autojson=True) - # Wrapper which sets proper header - # Doesn't work if the HTTPResponse has been raised - # like HTTP Error - def apiheader(): - response.set_header("Access-Control-Allow-Origin", "*") - # Attempt to retrieve and set locale def api18n(callback): def wrapper(*args, **kwargs): @@ -747,7 +741,6 @@ class Interface: # Install plugins app.install(filter_csrf) - app.add_hook("after_request", apiheader) app.install(api18n) actionsmapplugin = _ActionsMapPlugin(actionsmap, log_queues) app.install(actionsmapplugin) @@ -760,9 +753,6 @@ class Interface: # and our damned swagger api documentation tool def options_prefetch_cors(): response = HTTPResponse("", 200) - response.set_header("Access-Control-Allow-Origin", "*") - response.set_header("Access-Control-Allow-Headers", "x-requested-with") - response.set_header("Allow", "GET, POST, PUT, DELETE, OPTIONS") return response app.route('/<:re:.*>', method="OPTIONS",