Enable controller to have CORS

This commit is contained in:
Harshavardhana
2015-08-31 01:47:05 -07:00
parent dcf0c71ca3
commit f39ac24e99
9 changed files with 1111 additions and 1 deletions

View File

@@ -21,6 +21,7 @@ import (
router "github.com/gorilla/mux"
"github.com/minio/minio/pkg/rpc"
"github.com/rs/cors"
)
// getRPCHandler rpc handler
@@ -39,5 +40,5 @@ func getRPCHandler() http.Handler {
// registerRPC - register rpc handlers
func registerRPC(mux *router.Router, s *rpc.Server) http.Handler {
mux.Handle("/rpc", s)
return mux
return cors.Default().Handler(mux)
}