From 3d8795f7be4b4af2a3e8982aabaea5d2286e84f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rard=20Collin?= Date: Sat, 25 May 2024 11:26:44 +0200 Subject: [PATCH] Fixed cors header not set for data --- conf/nginx.conf | 13 +++++++++++++ manifest.toml | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index f3fb881..c0cc56e 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -8,6 +8,7 @@ location __PATH__/ { # Handling preflight requests if ($request_method = OPTIONS) { more_set_headers 'Access-Control-Allow-Methods: *' 'Access-Control-Allow-Headers: *'; + return 200; } # Path to source @@ -37,6 +38,10 @@ location __PATH__/ { } location __PATH__/project { + if ($request_method = OPTIONS) { + more_set_headers 'Access-Control-Allow-Methods: *' 'Access-Control-Allow-Headers: *'; + return 200; + } proxy_pass http://localhost:__PORT_PROJECT__/project; proxy_set_header Host $host; proxy_read_timeout 86400s; @@ -44,6 +49,10 @@ location __PATH__/ { } location __PATH__/data { + if ($request_method = OPTIONS) { + more_set_headers 'Access-Control-Allow-Methods: *' 'Access-Control-Allow-Headers: *'; + return 200; + } proxy_pass http://localhost:__PORT_DATA__/data; proxy_set_header Host $host; proxy_read_timeout 86400s; @@ -51,6 +60,10 @@ location __PATH__/ { } location __PATH__/documents { + if ($request_method = OPTIONS) { + more_set_headers 'Access-Control-Allow-Methods: *' 'Access-Control-Allow-Headers: *'; + return 200; + } proxy_pass http://localhost:__PORT_DATA__/documents; proxy_set_header Host $host; proxy_read_timeout 86400s; diff --git a/manifest.toml b/manifest.toml index fb36486..8fa4b9e 100644 --- a/manifest.toml +++ b/manifest.toml @@ -7,7 +7,7 @@ name = "Dont-code Services" description.en = "Install services and databases needed to support Dont-code platform" description.fr = "Installe les services et base de données nécessaires pour utiliser la plateforme Dont-code" -version = "0.3.2~ynh1" +version = "0.3.2~ynh2" maintainers = ["Dont-code Team"]