Skip to main content

decode_content_coding

Function decode_content_coding 

Source
pub fn decode_content_coding(
    body: &[u8],
    coding: Option<&str>,
    max_output: usize,
) -> Result<Vec<u8>, ModelError>
Expand description

Decode one HTTP content coding.

gzip and HTTP deflate (zlib) are decoded. identity and an omitted coding return the input. Any other coding is rejected so compressed bytes are not treated as artifact content.

ยงErrors

Returns an error for an unsupported coding, a truncated stream, raw DEFLATE presented as HTTP deflate, or output that would exceed max_output.