pub fn fetch_bytes(url: &str, max_size: u64) -> Result<Vec<u8>, ForgeError>Expand description
Fetch url, capped by max_size, streaming the body to a temp file.
Content-Length is checked before reading when present; the cap is then
enforced per chunk while streaming, so an oversized body is aborted
mid-download (temp deleted) instead of being buffered in full. At most
max_size bytes are ever held in memory (the final read-back). Redirects
are limited to 5; connect timeout is 30 s and the total request timeout
is 120 s.