Skip to content

Commit

Permalink
object_store: Disable all compression formats in HTTP reqwest client (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
kylewlacy authored Feb 19, 2025
1 parent 38d6e69 commit d0a2301
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions object_store/src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -685,9 +685,11 @@ impl ClientOptions {
builder = builder.danger_accept_invalid_certs(true)
}

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

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

0 comments on commit d0a2301

Please sign in to comment.