Expand description
Parsing of untrusted X-Forwarded-* header conventions.
These fields are widely deployed de facto conventions, not IETF standards.
The functions here only parse raw assertions; they do not establish trust or
select an effective client IP or request scheme. RFC 7239 Forwarded is the
standardized alternative for forwarding information; see
RFC 7239, Section 4.
Constants§
- X_
FORWARDED_ FOR - The de facto, non-IETF
X-Forwarded-Forfield name. - X_
FORWARDED_ PROTO - The de facto, non-IETF
X-Forwarded-Protofield name.
Functions§
- extract_
header_ x_ forwarded_ for - Extract all
X-Forwarded-Forfield lines as an untrusted asserted IP chain. - extract_
header_ x_ forwarded_ proto - Extract all
X-Forwarded-Protofield lines as untrusted protocol tokens. - extract_
request_ x_ forwarded_ for - Extract the untrusted
X-Forwarded-Forchain from a complete request. - extract_
request_ x_ forwarded_ proto - Extract untrusted
X-Forwarded-Prototokens from a complete request. - extract_
rightmost_ x_ forwarded_ for - Extract the rightmost
X-Forwarded-ForIP address from a header.