diff --git a/cmd/api-router.go b/cmd/api-router.go index 273833a0b..df4ee0110 100644 --- a/cmd/api-router.go +++ b/cmd/api-router.go @@ -34,7 +34,7 @@ func registerAPIRouter(mux *router.Router) { } // API Router - apiRouter := router.NewRouter().PathPrefix("/").Subrouter() + apiRouter := mux.NewRoute().PathPrefix("").Subrouter() // Bucket router bucket := apiRouter.PathPrefix("/{bucket}").Subrouter() diff --git a/cmd/generic-handlers.go b/cmd/generic-handlers.go index d91eccca2..81f3dc704 100644 --- a/cmd/generic-handlers.go +++ b/cmd/generic-handlers.go @@ -187,8 +187,7 @@ func parseAmzDateHeader(req *http.Request) (time.Time, APIErrorCode) { return time.Time{}, ErrMissingDateHeader } -type timeValidityHandler struct { -} +type timeValidityHandler struct{} func (h timeValidityHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { // Verify if date headers are set, if not reject the request diff --git a/cmd/server-main.go b/cmd/server-main.go index a2ac8b794..fade38aae 100644 --- a/cmd/server-main.go +++ b/cmd/server-main.go @@ -453,7 +453,7 @@ func serverMain(c *cli.Context) { tls := isSSL() // Fetch endpoints which we are going to serve from. - endPoints := finalizeEndpoints(tls, &apiServer.Server) + endPoints := finalizeEndpoints(tls, apiServer.Server) // Initialize local server address globalMinioAddr = getLocalAddress(srvConfig) diff --git a/cmd/server-mux.go b/cmd/server-mux.go index 259421416..ed47e155e 100644 --- a/cmd/server-mux.go +++ b/cmd/server-mux.go @@ -166,7 +166,7 @@ func (l *ListenerMux) Close() error { // ServerMux - the main mux server type ServerMux struct { - http.Server + *http.Server listeners []*ListenerMux WaitGroup *sync.WaitGroup GracefulTimeout time.Duration @@ -178,7 +178,7 @@ type ServerMux struct { // NewServerMux constructor to create a ServerMux func NewServerMux(addr string, handler http.Handler) *ServerMux { m := &ServerMux{ - Server: http.Server{ + Server: &http.Server{ Addr: addr, // Do not add any timeouts Golang net.Conn // closes connections right after 10mins even diff --git a/cmd/server-mux_test.go b/cmd/server-mux_test.go index 1df53346a..efcc392f9 100644 --- a/cmd/server-mux_test.go +++ b/cmd/server-mux_test.go @@ -118,7 +118,7 @@ func TestServerMux(t *testing.T) { })) // Set the test server config to the mux - ts.Config = &m.Server + ts.Config = m.Server ts.Start() // Create a ListenerMux @@ -171,7 +171,7 @@ func TestServerCloseBlocking(t *testing.T) { })) // Set the test server config to the mux - ts.Config = &m.Server + ts.Config = m.Server ts.Start() // Create a ListenerMux.