Skip to main content

Module headers

Module headers 

Source
Expand description

HTTP header constants for WiseGate.

This module centralizes all HTTP header names used throughout the codebase, avoiding magic strings and ensuring consistency.

Constants§

AUTHORIZATION
Authorization header (for Basic Auth).
CONNECTION
Connection header (hop-by-hop).
CONTENT_LENGTH
Content-Length header.
CONTENT_TYPE
Content-Type header.
FORWARDED
Forwarded header (RFC 7239) - standardized proxy header.
HOP_BY_HOP_HEADERS
List of all hop-by-hop headers that should not be forwarded.
HOST
Host header.
KEEP_ALIVE
Keep-Alive header (hop-by-hop).
PROXY_AUTHENTICATE
Proxy-Authenticate header (hop-by-hop).
PROXY_AUTHORIZATION
Proxy-Authorization header (hop-by-hop).
TE
TE header (hop-by-hop).
TRAILER
Trailer header (hop-by-hop, RFC 9110 section 7.6.1).
TRAILERSDeprecated
Former, misspelled name of TRAILER. trailers is a TE token, not a header field, so matching it never removed the Trailer header.
TRANSFER_ENCODING
Transfer-Encoding header (hop-by-hop).
UPGRADE
Upgrade header (hop-by-hop).
WWW_AUTHENTICATE
WWW-Authenticate header (for 401 responses).
X_FORWARDED_FOR
X-Forwarded-For header - contains the originating client IP.
X_REAL_IP
X-Real-IP header - injected by WiseGate for upstream services.

Functions§

connection_nominated
Returns the header names listed in the Connection header(s), lowercased.
is_hop_by_hop
Check if a header is a hop-by-hop header that shouldn’t be forwarded.
is_hop_by_hop_for
Returns true if a header must not be forwarded: either a fixed hop-by-hop header or one nominated by Connection (see connection_nominated).