Skip to main content

decode_content

Function decode_content 

Source
pub async fn decode_content(
    headers: &HeaderMap,
    body: Bytes,
    max_out: usize,
) -> Result<Bytes, HttpError>
Expand description

Decode the response bytes according to Content-Encoding.

Supports: gzip, deflate, br (Brotli).

Safety:

  • Caps the decoded output to max_out
  • Runs in spawn_blocking because flate2/brotli decode paths are synchronous