Skip to content

Commit

Permalink
gh-958 explicitly set CORS Allow-Headers
Browse files Browse the repository at this point in the history
Otherwise Firefox and Safari wouldn't accept the CORS preflight
(OPTIONS) request.
  • Loading branch information
etiennedi committed Aug 26, 2019
1 parent 56feea3 commit d374ddf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -86,3 +86,5 @@ data/
docker-compose/runtime-stable/data
docker-compose/runtime-unstable/data
c.out

esbackups/
2 changes: 1 addition & 1 deletion adapters/handlers/rest/middlewares.go
Expand Up @@ -78,7 +78,7 @@ func addPreflight(next http.Handler) http.Handler {
if r.Method == "OPTIONS" {
w.Header().Set("Access-Control-Allow-Origin", "*")
w.Header().Set("Access-Control-Allow-Methods", "*")
w.Header().Set("Access-Control-Allow-Headers", "*")
w.Header().Set("Access-Control-Allow-Headers", "Content-Type, Authorization, Batch")
return
}

Expand Down

0 comments on commit d374ddf

Please sign in to comment.