From 8abbd1ae8c39d1a737db4cec7174d01cbec8cbc1 Mon Sep 17 00:00:00 2001 From: David Welch Date: Fri, 1 Sep 2017 10:54:41 -0600 Subject: [PATCH] Allow PATCH in enable-cors --- controllers/nginx/rootfs/etc/nginx/template/nginx.tmpl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/controllers/nginx/rootfs/etc/nginx/template/nginx.tmpl b/controllers/nginx/rootfs/etc/nginx/template/nginx.tmpl index 375378e3c..ab9e7a83b 100644 --- a/controllers/nginx/rootfs/etc/nginx/template/nginx.tmpl +++ b/controllers/nginx/rootfs/etc/nginx/template/nginx.tmpl @@ -523,7 +523,7 @@ stream { # Om nom nom cookies # add_header 'Access-Control-Allow-Credentials' 'true'; - add_header 'Access-Control-Allow-Methods' 'GET, PUT, POST, DELETE, OPTIONS'; + add_header 'Access-Control-Allow-Methods' 'GET, PUT, POST, DELETE, PATCH, OPTIONS'; # # Custom headers and headers various browsers *should* be OK with but aren't # @@ -549,11 +549,14 @@ stream { if ($request_method = 'DELETE') { set $cors_method 1; } + if ($request_method = 'PATCH') { + set $cors_method 1; + } if ($cors_method = 1) { add_header 'Access-Control-Allow-Origin' '*' always; add_header 'Access-Control-Allow-Credentials' 'true'; - add_header 'Access-Control-Allow-Methods' 'GET, PUT, POST, DELETE, OPTIONS'; + add_header 'Access-Control-Allow-Methods' 'GET, PUT, POST, DELETE, PATCH, OPTIONS'; add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization'; } {{ end }}