minor #11655 Failing test for non-trusted proxies (ged15)
This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes #11655).
Discussion
----------
Failing test for non-trusted proxies
Discussion in #11583
@fabpot, should this test fail?
Commits
-------
e0e82bb
added tests for non-trusted proxies
This commit is contained in:
commit
822330580d
@ -1477,6 +1477,13 @@ class RequestTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertEquals(80, $request->getPort());
|
||||
$this->assertFalse($request->isSecure());
|
||||
|
||||
// request is forwarded by a non-trusted proxy
|
||||
Request::setTrustedProxies(array('2.2.2.2'));
|
||||
$this->assertEquals('3.3.3.3', $request->getClientIp());
|
||||
$this->assertEquals('example.com', $request->getHost());
|
||||
$this->assertEquals(80, $request->getPort());
|
||||
$this->assertFalse($request->isSecure());
|
||||
|
||||
// trusted proxy via setTrustedProxies()
|
||||
Request::setTrustedProxies(array('3.3.3.3', '2.2.2.2'));
|
||||
$this->assertEquals('1.1.1.1', $request->getClientIp());
|
||||
|
Reference in New Issue
Block a user