Skip to main content

read_response_capped

Function read_response_capped 

Source
pub async fn read_response_capped(
    response: Response,
    limit: usize,
) -> Result<Bytes>
Expand description

Buffer a remote response body, rejecting any response larger than limit bytes. reqwest enforces no response-size limit, so an unbounded bytes() lets a peer drive an allocator abort; refuse an oversized advertised length and hold the same bound while streaming for when that length is absent.