From 79f95a5c449bf0b19db0322356ad8b7f8e836d68 Mon Sep 17 00:00:00 2001 From: Andy Doan Date: Mon, 8 Apr 2024 11:18:32 -0500 Subject: [PATCH] client: Disable compression in default transport The default Golang client will advertise to the HTTP server that it can handle gzip compressed response encoding. This is true, but it breaks our artifacts.go code for doing download progress. This is because the default behavior of the transport is to: * provide the proper reader to decompress the response * update the content-length header to be -1 The -1 breaks our logic. This fix gets us back to how things used to work before CloudFlare started compressing the responses. Signed-off-by: Andy Doan --- client/foundries.go | 1 + 1 file changed, 1 insertion(+) diff --git a/client/foundries.go b/client/foundries.go index 3353cb8f..30fd6a8b 100644 --- a/client/foundries.go +++ b/client/foundries.go @@ -506,6 +506,7 @@ func NewApiClient(serverUrl string, config Config, caCertPath string, version st InsecureSkipVerify: config.InsecureSkipVerify, } http.DefaultTransport.(*http.Transport).TLSClientConfig = tlsCfg + http.DefaultTransport.(*http.Transport).DisableCompression = true if len(caCertPath) > 0 { rootCAs, _ := x509.SystemCertPool() if rootCAs == nil {