From 01e2dcb3641be2fc6fddc2ae23c6ff6cc232bab2 Mon Sep 17 00:00:00 2001 From: fvsqr <48791253+fvsqr@users.noreply.github.com> Date: Mon, 20 Jul 2020 19:11:26 +0200 Subject: [PATCH] StorageGrid compatibility (#2712) * remove explicit Accept-Encoding header For StorageGrid compatibility the Accept-Encoding header should not be set, otherwise StorageGrid compresses the already compressed log files which are only decompressed by the client once Signed-off-by: fvsqr <48791253+fvsqr@users.noreply.github.com> * Removed explicit gzip Accept-Encoding header For StorageGrid compatibility the Accept-Encoding header should not be set, otherwise StorageGrid compresses the already compressed log files which are only decompressed by the client once. Unclear, how this affects Backup endpoints from Azure or GCP Signed-off-by: fvsqr <48791253+fvsqr@users.noreply.github.com> * Create 2712-fvsqr Signed-off-by: fvsqr <48791253+fvsqr@users.noreply.github.com> --- changelogs/unreleased/2712-fvsqr | 1 + pkg/cmd/util/downloadrequest/downloadrequest.go | 5 ----- 2 files changed, 1 insertion(+), 5 deletions(-) create mode 100644 changelogs/unreleased/2712-fvsqr diff --git a/changelogs/unreleased/2712-fvsqr b/changelogs/unreleased/2712-fvsqr new file mode 100644 index 000000000..3f538fae9 --- /dev/null +++ b/changelogs/unreleased/2712-fvsqr @@ -0,0 +1 @@ +StorageGrid compatibility by removing explicit gzip accept header setting diff --git a/pkg/cmd/util/downloadrequest/downloadrequest.go b/pkg/cmd/util/downloadrequest/downloadrequest.go index bef8dd865..f302ba8fd 100644 --- a/pkg/cmd/util/downloadrequest/downloadrequest.go +++ b/pkg/cmd/util/downloadrequest/downloadrequest.go @@ -139,11 +139,6 @@ Loop: return err } - // Manually set this header so the net/http library does not automatically try to decompress. We - // need to handle this manually because it's not currently possible to set the MIME type for the - // pre-signed URLs for GCP or Azure. - httpReq.Header.Set("Accept-Encoding", "gzip") - resp, err := httpClient.Do(httpReq) if err != nil { if urlErr, ok := err.(*url.Error); ok {