@@ -158,6 +158,10 @@ getObject' bucket object queryParams headers = do
158158 riObject = Just object,
159159 riQueryParams = queryParams,
160160 riHeaders = headers
161+ -- This header is required for safety as otherwise http-client,
162+ -- sends Accept-Encoding: gzip, and the server may actually gzip
163+ -- body. In that case Content-Length header will be missing.
164+ <> [("Accept-Encoding", "identity")]
161165 }
162166
163167-- | Creates a bucket via a PUT bucket call.
@@ -550,8 +554,11 @@ headObject bucket object reqHeaders = do
550554 riBucket = Just bucket,
551555 riObject = Just object,
552556 riHeaders = reqHeaders
557+ -- This header is required for safety as otherwise http-client,
558+ -- sends Accept-Encoding: gzip, and the server may actually gzip
559+ -- body. In that case Content-Length header will be missing.
560+ <> [("Accept-Encoding", "identity")]
553561 }
554−
555562 maybe (throwIO MErrVInvalidObjectInfoResponse) return
556563 $ parseGetObjectHeaders object
557564 $ NC.responseHeaders resp