Neos\Flow\Tests\Unit\Http\Component\TrustedProxiesComponentTest::trustedClientIpAddressIsRightMostForwardedForAddressThatIsNotTrusted PHP Метод

trustedClientIpAddressIsRightMostForwardedForAddressThatIsNotTrusted() публичный Метод

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