Skip to main content

Module x_forwarded

Module x_forwarded 

Source
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-For field name.
X_FORWARDED_PROTO
The de facto, non-IETF X-Forwarded-Proto field name.

Functions§

extract_header_x_forwarded_for
Extract all X-Forwarded-For field lines as an untrusted asserted IP chain.
extract_header_x_forwarded_proto
Extract all X-Forwarded-Proto field lines as untrusted protocol tokens.
extract_request_x_forwarded_for
Extract the untrusted X-Forwarded-For chain from a complete request.
extract_request_x_forwarded_proto
Extract untrusted X-Forwarded-Proto tokens from a complete request.
extract_rightmost_x_forwarded_for
Extract the rightmost X-Forwarded-For IP address from a header.