File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,12 @@ use crate::common::buf::BufList;
7
7
///
8
8
/// The returned `impl Buf` groups the `Buf`s from the `HttpBody` without
9
9
/// copying them. This is ideal if you don't require a contiguous buffer.
10
+ ///
11
+ /// # Note
12
+ ///
13
+ /// Care needs to be taken if the remote is untrusted. The function doesn't implement any length
14
+ /// checks and an malicious peer might make it consume arbitrary amounts of memory. Checking the
15
+ /// `Content-Length` is a possibility, but it is not strictly mandated to be present.
10
16
pub async fn aggregate < T > ( body : T ) -> Result < impl Buf , T :: Error >
11
17
where
12
18
T : HttpBody ,
Original file line number Diff line number Diff line change @@ -7,6 +7,12 @@ use super::HttpBody;
7
7
/// This may require copying the data into a single buffer. If you don't need
8
8
/// a contiguous buffer, prefer the [`aggregate`](crate::body::aggregate())
9
9
/// function.
10
+ ///
11
+ /// # Note
12
+ ///
13
+ /// Care needs to be taken if the remote is untrusted. The function doesn't implement any length
14
+ /// checks and an malicious peer might make it consume arbitrary amounts of memory. Checking the
15
+ /// `Content-Length` is a possibility, but it is not strictly mandated to be present.
10
16
pub async fn to_bytes < T > ( body : T ) -> Result < Bytes , T :: Error >
11
17
where
12
18
T : HttpBody ,
You can’t perform that action at this time.
0 commit comments