diff --git a/cmd/routers.go b/cmd/routers.go index 8c993c8e3..7ca04e4a1 100644 --- a/cmd/routers.go +++ b/cmd/routers.go @@ -93,8 +93,12 @@ func configureServerHandler(endpointServerPools EndpointServerPools) (http.Handl registerDistErasureRouters(router, endpointServerPools) } - // Add STS router always. - registerSTSRouter(router) + // Register web router when its enabled. + if globalBrowserEnabled { + if err := registerWebRouter(router); err != nil { + return nil, err + } + } // Add Admin router, all APIs are enabled in server mode. registerAdminRouter(router, true, true) @@ -105,12 +109,8 @@ func configureServerHandler(endpointServerPools EndpointServerPools) (http.Handl // Add server metrics router registerMetricsRouter(router) - // Register web router when its enabled. - if globalBrowserEnabled { - if err := registerWebRouter(router); err != nil { - return nil, err - } - } + // Add STS router always. + registerSTSRouter(router) // Add API router registerAPIRouter(router)