From a332f3cb75d719bfbae6d6d08b547e53f4d3e142 Mon Sep 17 00:00:00 2001 From: mosen Date: Fri, 7 Oct 2016 09:59:15 +1100 Subject: [PATCH] Add warning when CORS feature is disabled. (#17) Add PATCH and DELETE methods to CORS because we do expose some of those in our endpoints. (cherry picked from commit 9445d93) --- main.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/main.go b/main.go index 58e1944a..5aa7816b 100644 --- a/main.go +++ b/main.go @@ -222,11 +222,13 @@ func main() { c := cors.New(cors.Options{ AllowedOrigins: []string{*flCorsOrigin}, AllowCredentials: true, + AllowedMethods: []string{"GET", "POST", "PATCH", "DELETE"}, }) corsHandler := c.Handler(mux) http.Handle("/", corsHandler) } else { + logger.Log("warn", "CORS header is disabled") http.Handle("/", mux) }