Allow PATCH in enable-cors
This commit is contained in:
parent
cda42f93c7
commit
8abbd1ae8c
1 changed files with 5 additions and 2 deletions
|
@ -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 }}
|
||||
|
|
Loading…
Reference in a new issue