Skip to main content

decide

Function decide 

Source
pub fn decide(
    limits: &ContentLimits,
    content_length: Option<&str>,
    content_type: Option<&str>,
) -> Result<Option<ContentBlock>, ContentLengthError>
Expand description

Carry one request’s size and content-type header values through the reference’s two sub-checks.

content_length is the raw content-length header value (None when the header is absent) and content_type the raw content-type header value (None when absent, compared as the empty string). Ok(None) means the request passes; Ok(Some(block)) is the reference’s block answer; the Err shape mirrors the reference’s non-integer content-length exception (answer the fail-secure 500 "Security check failed").