kylewlacy opened a new issue, #7142:
URL: https://github.com/apache/arrow-rs/issues/7142

   **Describe the bug**
   
   #6842 describes the problems that occur when the optional `gzip` feature is 
enabled in reqwest. The fix in #6843 addressed this by calling the 
[`reqwest::ClientBuilder.no_gzip()`](https://docs.rs/reqwest/latest/reqwest/struct.ClientBuilder.html#method.no_gzip)
 method.
   
   Reqwest offers other features that automatically enable compression on a 
supported server too: in addition to `gzip`, there's also `deflate`, `brotli`, 
and `zstd`. When any of these features are enabled, reqwest will include the 
`Accept-Encoding` header with supported compression formats, and supporting 
HTTP servers will reply with `Content-Encoding` indicating the accepted 
compression format (if any). When this happens, the `Content-Length` header 
will be set to the _compressed_ length of the body. That is, if it's set at 
all-- many servers will end up omitting the header when compression is enabled.
   
   **To Reproduce**
   
   1. Clone the example repo at this commit: 
https://github.com/kylewlacy/object_store_compression_repro/commit/256c8c0d0f27b54005348b129c3a43e418f0ec1a
   2. Run `cargo test` within the repo
   
   The test fails with the following error:
   
   ```
   thread 'tests::repro' panicked at src/lib.rs:32:14:
   called `Result::unwrap()` on an `Err` value: Generic { store: "HTTP", 
source: Header { source: MissingContentLength } }
   ```
   
   (Example repo based on the example from #6842, thanks @phillipleblanc for 
making an easy-to-use example for the previous bug!)
   
   **Expected behavior**
   
   The test should pass. It passes if the `zstd` feature is disabled in the 
reqwest crate.
   
   **Additional context**
   
   This example repo uses a local Axum server with gzip/deflate/brotli/zstd 
compression enabled, and with the `zstd` feature enabled on the reqwest crate. 
Therefore, the default reqwest client includes `Accept-Encoding: zstd` in the 
request, and the server responds with `Content-Encoding: zstd`. Because 
compression is enabled, reqwest does not (and cannot) return the decompressed 
content length of the response.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscr...@arrow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to