From ec401a4f1cca80bc5d6059473b8ee4907b5376a0 Mon Sep 17 00:00:00 2001 From: Adam Rowan <92474478+bear359@users.noreply.github.com> Date: Wed, 20 Apr 2022 12:51:57 -0600 Subject: [PATCH] fix: use correct auth token with consul_agent (#11001) (cherry picked from commit ecf7e948b2f995afb6c8af546e494f17403265cd) --- plugins/inputs/consul_agent/consul_agent.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/inputs/consul_agent/consul_agent.go b/plugins/inputs/consul_agent/consul_agent.go index 80a082c373579..fb74a4ef69e8d 100644 --- a/plugins/inputs/consul_agent/consul_agent.go +++ b/plugins/inputs/consul_agent/consul_agent.go @@ -115,7 +115,7 @@ func (n *ConsulAgent) loadJSON(url string) (*AgentInfo, error) { return nil, err } - req.Header.Set("Authorization", "X-Consul-Token "+n.Token) + req.Header.Add("X-Consul-Token", n.Token) req.Header.Add("Accept", "application/json") resp, err := n.roundTripper.RoundTrip(req)