final class HttpServerConfig (View source)

Carries the immutable trust policy used to resolve externally visible request metadata.

Methods

__construct(array $trustedProxies, ForwardedHeaderProfile $forwardedHeaderProfile, bool $trustForwardedPrefix, array $allowedHosts)

Captures normalized proxy networks, header policy and host allowlist.

array

Returns the exact IP addresses and CIDR networks permitted to supply forwarding metadata.

array
ForwardedHeaderProfile

Returns the single forwarding-header family accepted from a trusted peer.

ForwardedHeaderProfile
bool

Reports whether a trusted X-Forwarded-Prefix value may contribute the external path prefix.

bool
array

Returns exact hostnames and suffix wildcards approved for canonical request metadata.

array

Details

__construct

__construct(array $trustedProxies, ForwardedHeaderProfile $forwardedHeaderProfile, bool $trustForwardedPrefix, array $allowedHosts)

Captures normalized proxy networks, header policy and host allowlist.

Parameters

array $trustedProxies
ForwardedHeaderProfile $forwardedHeaderProfile
bool $trustForwardedPrefix
array $allowedHosts

trustedProxies

array trustedProxies()

Returns the exact IP addresses and CIDR networks permitted to supply forwarding metadata.

Return Value

array

forwardedHeaderProfile

ForwardedHeaderProfile forwardedHeaderProfile()

Returns the single forwarding-header family accepted from a trusted peer.

Return Value

ForwardedHeaderProfile

trustsForwardedPrefix

bool trustsForwardedPrefix()

Reports whether a trusted X-Forwarded-Prefix value may contribute the external path prefix.

Return Value

bool

allowedHosts

array allowedHosts()

Returns exact hostnames and suffix wildcards approved for canonical request metadata.

An empty list approves no request-derived host.

Return Value

array