From ff325293452f0212488ba1f909ece239bb7486fc Mon Sep 17 00:00:00 2001 From: Alex Antonov Date: Tue, 3 Apr 2018 03:00:07 -0500 Subject: [PATCH] Moved /api/cluster/leadership handler under public routes (requires no authentication) --- server/server.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/server/server.go b/server/server.go index b32b0cb2a..30ea7bf6f 100644 --- a/server/server.go +++ b/server/server.go @@ -744,9 +744,6 @@ func (s *Server) addInternalRoutes(entryPointName string, router *mux.Router) { if s.globalConfiguration.API != nil && s.globalConfiguration.API.EntryPoint == entryPointName { s.globalConfiguration.API.AddRoutes(router) - if s.leadership != nil { - s.leadership.AddRoutes(router) - } } } @@ -754,6 +751,10 @@ func (s *Server) addInternalPublicRoutes(entryPointName string, router *mux.Rout if s.globalConfiguration.Ping != nil && s.globalConfiguration.Ping.EntryPoint != "" && s.globalConfiguration.Ping.EntryPoint == entryPointName { s.globalConfiguration.Ping.AddRoutes(router) } + + if s.globalConfiguration.API != nil && s.globalConfiguration.API.EntryPoint == entryPointName && s.leadership != nil { + s.leadership.AddRoutes(router) + } } func (s *Server) addACMERoutes(entryPointName string, router *mux.Router) {