Skip to content

ForwardedAuthority

The scheme/host/port a reverse proxy says the client actually used, as resolved by ForwardedHeaderResolver.

Any field may be null when the corresponding header was absent or unusable.

$portExplicit distinguishes “the proxy told us a port” from “we inferred * nothing”: only an explicit port is written back into the request’s SERVER_PORT / authority, so a plain X-Forwarded-Proto: https does not silently pin port 80 from the original connection.

final readonly class ForwardedAuthority

SourceRuntime/Proxy/ForwardedAuthority.php
PropertyTypeDescription
$host?``stringreadonly.
$port?``intreadonly.
$portExplicitboolreadonly.
$scheme?``stringreadonly.

public function __construct(?string $scheme = null, ?string $host = null, ?int $port = null, bool $portExplicit = false): mixed

ParameterTypeDescription
$scheme?``string
$host?``string
$port?``int
$portExplicitbool

Returns mixed

MethodDescription
isEmpty(): boolTrue when there is nothing to apply, so callers can skip the rewrite entirely.

public function isEmpty(): bool

True when there is nothing to apply, so callers can skip the rewrite entirely.

Returns bool