Skip to main content

parse_client_ip

Function parse_client_ip 

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

Extract the most-specific client IP available from the request headers, falling back to none. Prefers Forwarded (RFC 7239) over the legacy X-Forwarded-For. Banks running behind a single trusted L7 take the leftmost entry; deeper proxy chains must verify and rewrite at the edge.