Request::setTrustedHeaderName()

static setTrustedHeaderName(string $key, string $value)

Sets the name for trusted headers.

The following header keys are supported:

  • Request::HEADERCLIENTIP: defaults to X-Forwarded-For (see getClientIp())
  • Request::HEADERCLIENTHOST: defaults to X-Forwarded-Host (see getHost())
  • Request::HEADERCLIENTPORT: defaults to X-Forwarded-Port (see getPort())
  • Request::HEADERCLIENTPROTO: defaults to X-Forwarded-Proto (see getScheme() and isSecure())

Setting an empty value allows to disable the trusted header for the given key.

Parameters

string $key The header key
string $value The header name

Exceptions

InvalidArgumentException
doc_Symfony
2016-10-28 06:29:34
Comments
Leave a Comment

Please login to continue.