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).
TRAILERS
Trailers header (hop-by-hop).
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§

is_hop_by_hop
Check if a header is a hop-by-hop header that shouldn’t be forwarded.