diff --git a/src/Network/Minio/S3API.hs b/src/Network/Minio/S3API.hs index ce05771..f016951 100644 --- a/src/Network/Minio/S3API.hs +++ b/src/Network/Minio/S3API.hs @@ -158,6 +158,10 @@ getObject' bucket object queryParams headers = do riObject = Just object, riQueryParams = queryParams, riHeaders = headers + -- This header is required for safety as otherwise http-client, + -- sends Accept-Encoding: gzip, and the server may actually gzip + -- body. In that case Content-Length header will be missing. + <> [("Accept-Encoding", "identity")] } -- | Creates a bucket via a PUT bucket call. @@ -550,8 +554,11 @@ headObject bucket object reqHeaders = do riBucket = Just bucket, riObject = Just object, riHeaders = reqHeaders + -- This header is required for safety as otherwise http-client, + -- sends Accept-Encoding: gzip, and the server may actually gzip + -- body. In that case Content-Length header will be missing. + <> [("Accept-Encoding", "identity")] } - maybe (throwIO MErrVInvalidObjectInfoResponse) return $ parseGetObjectHeaders object $ NC.responseHeaders resp