Explorar o código

Allow Content-Type and Accept headers to CORS policy

Frédéric Guillot %!s(int64=3) %!d(string=hai) anos
pai
achega
3d64162f06
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      api/middleware.go

+ 1 - 1
api/middleware.go

@@ -25,7 +25,7 @@ func (m *middleware) handleCORS(next http.Handler) http.Handler {
 	return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
 		w.Header().Set("Access-Control-Allow-Origin", "*")
 		w.Header().Set("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, OPTIONS")
-		w.Header().Set("Access-Control-Allow-Headers", "X-Auth-Token, Authorization")
+		w.Header().Set("Access-Control-Allow-Headers", "X-Auth-Token, Authorization, Content-Type, Accept")
 		if r.Method == http.MethodOptions {
 			w.Header().Set("Access-Control-Max-Age", "3600")
 			w.WriteHeader(http.StatusOK)