Skip to content

Commit 798b72f

Browse files
authored
Merge pull request #24 from umaralam-lt/feature/add-gzip-header
feat: add gzip Accept-Encoding header to HTTP requests
2 parents 4a7b162 + 1fd6981 commit 798b72f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pkg/experiment/local/client.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ func (c *Client) doFlagsV2() (map[string]*evaluation.Flag, error) {
163163
req = req.WithContext(ctx)
164164
req.Header.Set("Authorization", fmt.Sprintf("Api-Key %s", c.apiKey))
165165
req.Header.Set("Content-Type", "application/json; charset=UTF-8")
166+
req.Header.Set("Accept-Encoding", "gzip")
166167
req.Header.Set("X-Amp-Exp-Library", fmt.Sprintf("experiment-go-server/%v", experiment.VERSION))
167168
resp, err := client.Do(req)
168169
if err != nil {
@@ -206,6 +207,7 @@ func (c *Client) doRules() (map[string]interface{}, error) {
206207
req = req.WithContext(ctx)
207208
req.Header.Set("Authorization", fmt.Sprintf("Api-Key %s", c.apiKey))
208209
req.Header.Set("Content-Type", "application/json; charset=UTF-8")
210+
req.Header.Set("Accept-Encoding", "gzip")
209211
req.Header.Set("X-Amp-Exp-Library", fmt.Sprintf("experiment-go-server/%v", experiment.VERSION))
210212
resp, err := c.client.Do(req)
211213
if err != nil {

0 commit comments

Comments
 (0)