mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
[enh] Remove unworking CORS headers
This commit is contained in:
parent
3f8f573d7e
commit
bddef3e241
1 changed files with 0 additions and 10 deletions
|
@ -727,12 +727,6 @@ class Interface:
|
||||||
# TODO: Return OK to 'OPTIONS' xhr requests (l173)
|
# TODO: Return OK to 'OPTIONS' xhr requests (l173)
|
||||||
app = Bottle(autojson=True)
|
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
|
# Attempt to retrieve and set locale
|
||||||
def api18n(callback):
|
def api18n(callback):
|
||||||
def wrapper(*args, **kwargs):
|
def wrapper(*args, **kwargs):
|
||||||
|
@ -747,7 +741,6 @@ class Interface:
|
||||||
|
|
||||||
# Install plugins
|
# Install plugins
|
||||||
app.install(filter_csrf)
|
app.install(filter_csrf)
|
||||||
app.add_hook("after_request", apiheader)
|
|
||||||
app.install(api18n)
|
app.install(api18n)
|
||||||
actionsmapplugin = _ActionsMapPlugin(actionsmap, log_queues)
|
actionsmapplugin = _ActionsMapPlugin(actionsmap, log_queues)
|
||||||
app.install(actionsmapplugin)
|
app.install(actionsmapplugin)
|
||||||
|
@ -760,9 +753,6 @@ class Interface:
|
||||||
# and our damned swagger api documentation tool
|
# and our damned swagger api documentation tool
|
||||||
def options_prefetch_cors():
|
def options_prefetch_cors():
|
||||||
response = HTTPResponse("", 200)
|
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
|
return response
|
||||||
|
|
||||||
app.route('/<:re:.*>', method="OPTIONS",
|
app.route('/<:re:.*>', method="OPTIONS",
|
||||||
|
|
Loading…
Add table
Reference in a new issue