Skip to content

Commit

Permalink
GH-171: Access-Control-Allow-Headers mirrors the Access-Control-Reque…
Browse files Browse the repository at this point in the history
…st-Headers values.
  • Loading branch information
jirenius committed Sep 5, 2020
1 parent af2aa44 commit a7e139c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions server/apiHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ func (s *Service) apiHandler(w http.ResponseWriter, r *http.Request) {
err := s.setCommonHeaders(w, r)
if r.Method == "OPTIONS" {
w.Header().Set("Access-Control-Allow-Methods", s.cfg.allowMethods)
reqHeaders := r.Header["Access-Control-Request-Headers"]
if len(reqHeaders) > 0 {
w.Header()["Access-Control-Allow-Headers"] = reqHeaders
}
return
}
if err != nil {
Expand Down

0 comments on commit a7e139c

Please sign in to comment.