Neos\Flow\Tests\Unit\Http\Component\TrustedProxiesComponentTest::trustedClientIpAddressIsForwardedForAddressIfProxyTrusted PHP Method

trustedClientIpAddressIsForwardedForAddressIfProxyTrusted() public method

    public function trustedClientIpAddressIsForwardedForAddressIfProxyTrusted()
    {
        $this->withTrustedProxiesSettings(['proxies' => ['127.0.0.1'], 'headers' => [TrustedProxiesComponent::HEADER_CLIENT_IP => 'X-Forwarded-For']]);
        $request = Request::create(new Uri('https://acme.com'), 'GET', array(), array(), array('HTTP_X_FORWARDED_FOR' => '13.0.0.1'));
        $trustedRequest = $this->callWithRequest($request);
        $this->assertEquals('13.0.0.1', $trustedRequest->getAttribute(Request::ATTRIBUTE_CLIENT_IP));
    }