Skip to main content

extract_header_authorization

Function extract_header_authorization 

Source
pub fn extract_header_authorization(
    headers: &HeaderMap,
) -> Result<Option<&str>, Error>
Expand description

Extract the singular Authorization field as text.

A missing field returns None. The value is returned unchanged, including an empty value. Duplicate field lines or a non-text value return an error that does not contain the sensitive value. This function does not parse, validate, decode, or authenticate the field, and callers must not log or echo it. See the HTTP authentication framework in RFC 9110, Section 11.