mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
[wip] Enable CORS on API
This commit is contained in:
parent
92a751ed84
commit
ec5ce84afd
1 changed files with 9 additions and 0 deletions
|
@ -6,6 +6,15 @@ location /yunohost/api/ {
|
|||
proxy_set_header Connection "upgrade";
|
||||
proxy_set_header Host $http_host;
|
||||
|
||||
# Rewrite CORS headers due to bug inside moulinette
|
||||
# cause it's very difficult to add them with bottle
|
||||
# framework 0.12.
|
||||
# https://github.com/YunoHost/moulinette/pull/324
|
||||
more_set_headers "Access-Control-Allow-Origin : *";
|
||||
more_set_headers "Access-Control-Allow-Headers: x-requested-with";
|
||||
more_set_headers "Allow: GET, POST, PUT, DELETE, OPTIONS";
|
||||
more_set_headers "Access-Control-Allow-Credentials: true";
|
||||
|
||||
{% if webadmin_allowlist_enabled == "True" %}
|
||||
{% for ip in webadmin_allowlist.split(',') %}
|
||||
allow {{ ip }};
|
||||
|
|
Loading…
Add table
Reference in a new issue