From 8769aa344a22756221a20a8bb3ee1e5d7f5ef952 Mon Sep 17 00:00:00 2001 From: Marcos Lilljedahl Date: Sat, 14 Oct 2017 12:50:11 -0300 Subject: [PATCH] Add methods in CORS requests --- handlers/bootstrap.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/handlers/bootstrap.go b/handlers/bootstrap.go index 9fbd42f..e46bdae 100644 --- a/handlers/bootstrap.go +++ b/handlers/bootstrap.go @@ -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")