Skip to content

Commit

Permalink
fixup! client: Disable compression in default transport
Browse files Browse the repository at this point in the history
  • Loading branch information
doanac committed Apr 9, 2024
1 parent 79f95a5 commit 34484a7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions client/foundries.go
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,12 @@ func NewApiClient(serverUrl string, config Config, caCertPath string, version st
InsecureSkipVerify: config.InsecureSkipVerify,
}
http.DefaultTransport.(*http.Transport).TLSClientConfig = tlsCfg
// targets/artifacts.go needs to know the Content-Length in order to
// compute the download progress. If certain services like CloudFlare
// see the client accepts compressed responsed (content-encoding not
// content-type) then it will give a compressed response. Golang will
// automagically decompress as you read the response *and* set
// content-length to -1 thereby breaking our download progress logic
http.DefaultTransport.(*http.Transport).DisableCompression = true
if len(caCertPath) > 0 {
rootCAs, _ := x509.SystemCertPool()
Expand Down

0 comments on commit 34484a7

Please sign in to comment.