Merge pull request #10189 from hashicorp/dnephin/http-api-health-query-meta

http: set consistency header properly for health endpoint
This commit is contained in:
Daniel Nephin 2021-05-06 14:05:12 -04:00 committed by hc-github-team-consul-core
parent a71d3e6f2d
commit dd6257e17c
2 changed files with 5 additions and 1 deletions

4
.changelog/10189.txt Normal file
View File

@ -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
```

View File

@ -227,8 +227,8 @@ func (s *HTTPHandlers) healthServiceNodes(resp http.ResponseWriter, req *http.Re
if args.QueryOptions.UseCache { if args.QueryOptions.UseCache {
setCacheMeta(resp, &md) setCacheMeta(resp, &md)
} }
out.QueryMeta.ConsistencyLevel = args.QueryOptions.ConsistencyLevel()
setMeta(resp, &out.QueryMeta) setMeta(resp, &out.QueryMeta)
out.ConsistencyLevel = args.QueryOptions.ConsistencyLevel()
// FIXME: argument parsing should be done before performing the rpc // FIXME: argument parsing should be done before performing the rpc
// Filter to only passing if specified // Filter to only passing if specified