Browse Source

Added Access-Control-Allow-Headers to allow cors requests with those headers

Chris Ridde 11 years ago
parent
commit
d9df58beb8
1 changed files with 1 additions and 0 deletions
  1. 1 0
      http/cors.go

+ 1 - 0
http/cors.go

@@ -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