Explorar el Código

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

Chris Ridde hace 11 años
padre
commit
d9df58beb8
Se han modificado 1 ficheros con 1 adiciones y 0 borrados
  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