From ca41f80493b673749c799ed6a97c4560f8f2e8fc Mon Sep 17 00:00:00 2001 From: Chris Piraino Date: Tue, 9 Jun 2020 14:45:21 -0500 Subject: [PATCH] Set connect or ingress boolean after checking for query param --- agent/health_endpoint.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/agent/health_endpoint.go b/agent/health_endpoint.go index 7ece2b06e4..9573ae691b 100644 --- a/agent/health_endpoint.go +++ b/agent/health_endpoint.go @@ -164,7 +164,7 @@ func (s *HTTPServer) HealthServiceNodes(resp http.ResponseWriter, req *http.Requ func (s *HTTPServer) healthServiceNodes(resp http.ResponseWriter, req *http.Request, connect bool) (interface{}, error) { // Set default DC - args := structs.ServiceSpecificRequest{Connect: connect} + args := structs.ServiceSpecificRequest{} if err := s.parseEntMetaNoWildcard(req, &args.EnterpriseMeta); err != nil { return nil, err } @@ -185,19 +185,19 @@ func (s *HTTPServer) healthServiceNodes(resp http.ResponseWriter, req *http.Requ prefix := "/v1/health/service/" if connect { prefix = "/v1/health/connect/" - } - // Check for ingress request only when requesting connect services - if connect { + // Check for ingress request only when requesting connect services ingress, err := getBoolQueryParam(params, "ingress") if err != nil { resp.WriteHeader(http.StatusBadRequest) fmt.Fprint(resp, "Invalid value for ?ingress") return nil, nil } + if ingress { - args.Connect = false args.Ingress = true + } else { + args.Connect = true } }