gaius-qi opened a new issue, #6857:
URL: https://github.com/apache/opendal/issues/6857
### Describe the bug
When gzip, brotli, zstd, or deflate support is enabled in reqwest, OpenDAL
fails to correctly get the Content-Length for OSS objects.
### Steps to Reproduce
```rust
use opendal::{Operator, layers::HttpClientLayer, layers::TimeoutLayer,
raw::HttpClient};
use std::time::Duration;
#[tokio::main]
async fn main() {
let builder = opendal::services::Oss::default();
let builder = builder
.access_key_id("")
.access_key_secret("")
.endpoint("")
.root("/")
.bucket("");
let operator = Operator::new(builder)
.unwrap()
.finish()
.layer(TimeoutLayer::new().with_timeout(Duration::from_secs(10)))
.layer(HttpClientLayer::new(HttpClient::with(
reqwest::Client::builder().build().unwrap(),
)));
let metadata = operator.stat_with("").await.unwrap();
println!("content length: {:?}", metadata.content_length());
}
```
```yaml
[package]
name = "opendal"
version = "0.1.0"
edition = "2024"
[dependencies]
tokio = { version = "1.28.1", features = ["full"] }
tracing = "0.1"
opendal = { version = "0.54.1", features = [
"services-s3",
"services-azblob",
"services-gcs",
"services-oss",
"services-obs",
"services-cos",
"services-webhdfs",
] }
reqwest = { version = "0.12.24", features = [
"stream",
"gzip",
"brotli",
"zstd",
"deflate",
] }
```
### Expected Behavior
```text
# expected output
content length: xxx
```
### Additional Context
_No response_
### Are you willing to submit a PR to fix this bug?
- [ ] Yes, I would like to submit a PR.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]