From cd55f89f84ad2af5e2098667b7aff28d5e2bd6c7 Mon Sep 17 00:00:00 2001 From: Daniel Nephin Date: Thu, 6 May 2021 14:05:12 -0400 Subject: [PATCH] Merge pull request #10189 from hashicorp/dnephin/http-api-health-query-meta http: set consistency header properly for health endpoint --- .changelog/10189.txt | 4 ++++ agent/health_endpoint.go | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 .changelog/10189.txt diff --git a/.changelog/10189.txt b/.changelog/10189.txt new file mode 100644 index 0000000000..7cd8cf5706 --- /dev/null +++ b/.changelog/10189.txt @@ -0,0 +1,4 @@ +```release-note:bug +http: fix a bug that caused the `X-Consul-Effective-Consistency` header to be missing on +request for service health +``` diff --git a/agent/health_endpoint.go b/agent/health_endpoint.go index cdfccd39f2..a0cfbfd100 100644 --- a/agent/health_endpoint.go +++ b/agent/health_endpoint.go @@ -234,8 +234,8 @@ func (s *HTTPHandlers) healthServiceNodes(resp http.ResponseWriter, req *http.Re if args.QueryOptions.UseCache { setCacheMeta(resp, &md) } + out.QueryMeta.ConsistencyLevel = args.QueryOptions.ConsistencyLevel() setMeta(resp, &out.QueryMeta) - out.ConsistencyLevel = args.QueryOptions.ConsistencyLevel() // FIXME: argument parsing should be done before performing the rpc // Filter to only passing if specified