Skip to main content

extract_header_forwarded_for

Function extract_header_forwarded_for 

Source
pub fn extract_header_forwarded_for(
    headers: &HeaderMap,
) -> Result<Option<Vec<IpAddr>>, Error>
Expand description

Extract RFC 7239 Forwarded for= values as an untrusted IP chain.

Addresses are returned in wire order, from the remotest assertion to the one nearest the server. A missing field returns None; an empty field is invalid. Parsing does not make any address trustworthy. This crate’s strict profile requires exactly one field line and exactly one usable IP for= parameter in every element. Duplicate or non-text field lines, ambiguous element boundaries, missing or duplicate for parameters, and unknown, obfuscated, or non-IP for nodes return an error. They are never skipped because doing so would change the chain’s meaning. Parameters other than for are ignored without validating their names or values. Establish an out-of-band proxy trust policy before using the chain for a security decision.