Skip to content

armgit / mwmbl

Public Imported from GitHub
0

An open source, non-profit web search engine

Allow more headers for CORS

Daoud Clarke0d1c5ded911f
diff --git a/nginx.conf.sigil b/nginx.conf.sigil
index 0d97b27..aff1a3a 100644
--- a/nginx.conf.sigil
+++ b/nginx.conf.sigil
@@ -47,7 +47,7 @@ server {
#
# Custom headers and headers various browsers *should* be OK with but aren't
#
- add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
+ add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Authorization,X-API-Key';
#
# Tell client that this pre-flight info is valid for 20 days
#
@@ -58,14 +58,14 @@ server {
}
if ($request_method = 'POST') {
add_header 'Access-Control-Allow-Origin' '*' always;
- add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
- add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range' always;
+ add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, DELETE' always;
+ add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Authorization,X-API-Key' always;
add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range' always;
}
if ($request_method = 'GET') {
add_header 'Access-Control-Allow-Origin' '*' always;
- add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
- add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range' always;
+ add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, DELETE' always;
+ add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Authorization,X-API-Key' always;
add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range' always;
}
### End CORS