Skip to content

Commit d0a2301

Browse files
authored
object_store: Disable all compression formats in HTTP reqwest client (#7143)
1 parent 38d6e69 commit d0a2301

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

object_store/src/client/mod.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -685,9 +685,11 @@ impl ClientOptions {
685685
builder = builder.danger_accept_invalid_certs(true)
686686
}
687687

688-
// Reqwest will remove the `Content-Length` header if it is configured to
689-
// transparently decompress the body via the non-default `gzip` feature.
690-
builder = builder.no_gzip();
688+
// Explicitly disable compression, since it may be automatically enabled
689+
// when certain reqwest features are enabled. Compression interferes
690+
// with the `Content-Length` header, which is used to determine the
691+
// size of objects.
692+
builder = builder.no_gzip().no_brotli().no_zstd().no_deflate();
691693

692694
if self.randomize_addresses.get()? {
693695
builder = builder.dns_resolver(Arc::new(dns::ShuffleResolver));

0 commit comments

Comments
 (0)