Skip to content

Commit 97a4047

Browse files
committed
Set length to None when setting body reader on response
1 parent ea8acc2 commit 97a4047

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/response.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,12 @@ impl Response {
3737
&self.status
3838
}
3939

40-
/// Set the body.
40+
/// Set the body reader to `body` and unset the length.
41+
///
42+
/// This will make the body a chunked stream.
4143
pub fn set_body_reader(mut self, body: impl BufRead + Unpin + Send + 'static) -> Self {
4244
self.body_reader = Box::new(body);
45+
self.length = None;
4346
self
4447
}
4548

0 commit comments

Comments
 (0)