Add methods in CORS requests

This commit is contained in:
Marcos Lilljedahl
2017-10-14 12:50:11 -03:00
parent 4baa3447f0
commit 8769aa344a

View File

@@ -43,7 +43,7 @@ func Register(extend HandlerExtender) {
r := mux.NewRouter()
corsRouter := mux.NewRouter()
corsHandler := gh.CORS(gh.AllowCredentials(), gh.AllowedHeaders([]string{"x-requested-with", "content-type"}), gh.AllowedOrigins([]string{"*"}))
corsHandler := gh.CORS(gh.AllowCredentials(), gh.AllowedHeaders([]string{"x-requested-with", "content-type"}), gh.AllowedMethods([]string{"GET", "POST", "HEAD", "DELETE"}), gh.AllowedOrigins([]string{"*"}))
// Specific routes
r.HandleFunc("/ping", Ping).Methods("GET")