CORS using gorilla handles always doesnt return Access-Control-Allow-Methods hea


(Ram Mohan) #1

I am using CORS using gorilla handlers issues i am facing are

  1. it can give max-age max value just 10 minutes no way to change it.
  2. it doesnot send Access-Control-Allow-Methods header with all the Methods which i provide to CORS.
  3. it doesnot send Access-Control-Allow-Headers header with all the Header which i provide to CORS.
	headersOk := handlers.AllowedHeaders([]string{"Authorization", "X-Requested-With"})
	originsOk := handlers.AllowedOrigins([]string{"localhost.com", "*"})
	methodsOk := handlers.AllowedMethods([]string{"GET", "HEAD", "POST", "PUT", "OPTIONS"})
        log.Fatal(http.ListenAndServe(":8080", handlers.CORS(originsOk, methodsOk, headersOk, handlers.MaxAge(18600))(r)))