Skip to main content

parse_bearer

Function parse_bearer 

Source
pub fn parse_bearer(header: Option<&str>) -> Option<(&str, &str)>
Expand description

Splits Authorization: Bearer <key_id>:<secret> into its two parts.

The header is case-insensitive on the scheme. Returns None for a missing header, a non-Bearer scheme, or a token without a :, so the caller can answer with a single 401 in every case.