Skip to main content

bearer_token

Function bearer_token 

Source
pub fn bearer_token(headers: &HeaderMap) -> Option<String>
Expand description

Extract the bearer token from the Authorization header.

Returns None if the header is absent, not valid UTF-8, not the Bearer scheme (compared case-insensitively per RFC 7235), or carries an empty token. Pure and independently testable.