We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 404df59 commit ce3b30eCopy full SHA for ce3b30e
src/async_impl/h3_client/pool.rs
@@ -127,9 +127,18 @@ impl PoolClient {
127
req: Request<Body>,
128
) -> Result<Response<ResponseBody>, BoxError> {
129
use http_body_util::{BodyExt, Full};
130
+ use hyper::body::Body as _;
131
132
let (head, req_body) = req.into_parts();
- let req = Request::from_parts(head, ());
133
+ let mut req = Request::from_parts(head, ());
134
+
135
+ if let Some(n) = req_body.size_hint().exact() {
136
+ if n > 0 {
137
+ req.headers_mut()
138
+ .insert(http::header::CONTENT_LENGTH, n.into());
139
+ }
140
141
142
let mut stream = self.inner.send_request(req).await?;
143
144
match req_body.as_bytes() {
0 commit comments