Skip to main content

header

Function header 

Source
pub fn header<'a>(
    map: &'a BTreeMap<String, String>,
    name: &str,
) -> Option<&'a str>
Expand description

Case-insensitive header lookup.

HTTP header names are case-insensitive on the wire (RFC 9110). The fixtures store them lower-cased by convention, but rules call header(headers, "Authorization") and header(headers, "x-signature") interchangeably — this helper makes both work.

Returns the value of the first matching header. Iteration order is stable because BTreeMap is ordered, but in practice header names are unique within a case fixture.