Send "Accept-Encoding" header in read request (#4421)

We should be doing this since we only accept Snappy-encoded responses.

Signed-off-by: Henri DF <henridf@gmail.com>
This commit is contained in:
Henri DF 2018-07-26 04:45:04 -07:00 committed by Brian Brazil
parent 3abb2cc349
commit ffb7836c14
1 changed files with 1 additions and 0 deletions

View File

@ -137,6 +137,7 @@ func (c *Client) Read(ctx context.Context, query *prompb.Query) (*prompb.QueryRe
return nil, fmt.Errorf("unable to create request: %v", err)
}
httpReq.Header.Add("Content-Encoding", "snappy")
httpReq.Header.Add("Accept-Encoding", "snappy")
httpReq.Header.Set("Content-Type", "application/x-protobuf")
httpReq.Header.Set("X-Prometheus-Remote-Read-Version", "0.1.0")