Allow PATCH in enable-cors

This commit is contained in:
David Welch 2017-09-01 10:54:41 -06:00 committed by GitHub
parent cda42f93c7
commit 8abbd1ae8c

View file

@ -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 }}