CORS: cors handling should be before auth handling. cors should allow PUT.

This commit is contained in:
Krishna Srinivas
2016-01-28 22:53:05 +05:30
parent ed69c58490
commit 81b255511f
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -126,7 +126,7 @@ func (h timeHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
func CorsHandler(h http.Handler) http.Handler {
c := cors.New(cors.Options{
AllowedOrigins: []string{"*"},
AllowedMethods: []string{"GET", "HEAD", "POST"},
AllowedMethods: []string{"GET", "HEAD", "POST", "PUT"},
AllowedHeaders: []string{"*"},
})
return c.Handler(h)