Skip to content

Commit

Permalink
Merge pull request #886 from christriddle/master
Browse files Browse the repository at this point in the history
Added Access-Control-Allow-Headers for CORS requests
  • Loading branch information
philips committed Jul 10, 2014
2 parents 1cffdb3 + d9df58b commit 877b3d5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions http/cors.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ type CORSHandler struct {
func (h *CORSHandler) addHeader(w http.ResponseWriter, origin string) {
w.Header().Add("Access-Control-Allow-Methods", "POST, GET, OPTIONS, PUT, DELETE")
w.Header().Add("Access-Control-Allow-Origin", origin)
w.Header().Add("Access-Control-Allow-Headers", "accept, content-type")
}

// ServeHTTP adds the correct CORS headers based on the origin and returns immediately
Expand Down

0 comments on commit 877b3d5

Please sign in to comment.