Skip to content

Commit

Permalink
add header to request 7.x compatible response
Browse files Browse the repository at this point in the history
  • Loading branch information
BinaryFissionGames committed Jan 6, 2022
1 parent e15c6d6 commit d228031
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions receiver/elasticsearchreceiver/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@ func (c defaultElasticsearchClient) doRequest(ctx context.Context, path string)
req.Header.Add("Authorization", c.authHeader)
}

// See https://www.elastic.co/guide/en/elasticsearch/reference/8.0/api-conventions.html#api-compatibility
// the compatible-with=7 should signal to newer version of Elasticsearch to use the v7.x API format
req.Header.Add("Accept", "application/vnd.elasticsearch+json; compatible-with=7")

resp, err := c.client.Do(req)
if err != nil {
return nil, err
Expand Down

0 comments on commit d228031

Please sign in to comment.