Fix Agent handling of gzipped responses (#7470)
* Fix Agent handling of gzipped responses Fixes #6606 * Only remove "gzip" member, if present * Simplify to just removing Accept-Encoding altogether
This commit is contained in:
parent
73b9e39775
commit
3621179560
5
command/agent/cache/api_proxy.go
vendored
5
command/agent/cache/api_proxy.go
vendored
|
@ -36,6 +36,11 @@ func (ap *APIProxy) Send(ctx context.Context, req *SendRequest) (*SendResponse,
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
client.SetToken(req.Token)
|
client.SetToken(req.Token)
|
||||||
|
|
||||||
|
// http.Transport will transparently request gzip and decompress the response, but only if
|
||||||
|
// the client doesn't manually set the header. Removing any Accept-Encoding header allows the
|
||||||
|
// transparent compression to occur.
|
||||||
|
req.Request.Header.Del("Accept-Encoding")
|
||||||
client.SetHeaders(req.Request.Header)
|
client.SetHeaders(req.Request.Header)
|
||||||
|
|
||||||
fwReq := client.NewRequest(req.Request.Method, req.Request.URL.Path)
|
fwReq := client.NewRequest(req.Request.Method, req.Request.URL.Path)
|
||||||
|
|
Loading…
Reference in a new issue