You are here

public static function Request::getTrustedHeaderName in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/http-foundation/Request.php \Symfony\Component\HttpFoundation\Request::getTrustedHeaderName()

Gets the trusted proxy header name.

Parameters

string $key The header key:

Return value

string The header name

Throws

\InvalidArgumentException

5 calls to Request::getTrustedHeaderName()
InlineFragmentRenderer::createSubRequest in vendor/symfony/http-kernel/Fragment/InlineFragmentRenderer.php
InlineFragmentRendererTest::testESIHeaderIsKeptInSubrequest in vendor/symfony/http-kernel/Tests/Fragment/InlineFragmentRendererTest.php
InlineFragmentRendererTest::testESIHeaderIsKeptInSubrequestWithTrustedHeaderDisabled in vendor/symfony/http-kernel/Tests/Fragment/InlineFragmentRendererTest.php
InlineFragmentRendererTest::testRenderWithTrustedHeaderDisabled in vendor/symfony/http-kernel/Tests/Fragment/InlineFragmentRendererTest.php
RequestTest::testGetTrustedProxiesInvalidHeaderName in vendor/symfony/http-foundation/Tests/RequestTest.php
@expectedException \InvalidArgumentException

File

vendor/symfony/http-foundation/Request.php, line 624

Class

Request
Request represents an HTTP request.

Namespace

Symfony\Component\HttpFoundation

Code

public static function getTrustedHeaderName($key) {
  if (!array_key_exists($key, self::$trustedHeaders)) {
    throw new \InvalidArgumentException(sprintf('Unable to get the trusted header name for key "%s".', $key));
  }
  return self::$trustedHeaders[$key];
}