Skip to content

Commit 8223305

Browse files
committed
minor symfony#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 symfony#11655). Discussion ---------- Failing test for non-trusted proxies Discussion in symfony#11583 @fabpot, should this test fail? Commits ------- e0e82bb added tests for non-trusted proxies
2 parents 59362a9 + e0e82bb commit 8223305

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/Symfony/Component/HttpFoundation/Tests/RequestTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1477,6 +1477,13 @@ public function testTrustedProxies()
14771477
$this->assertEquals(80, $request->getPort());
14781478
$this->assertFalse($request->isSecure());
14791479

1480+
// request is forwarded by a non-trusted proxy
1481+
Request::setTrustedProxies(array('2.2.2.2'));
1482+
$this->assertEquals('3.3.3.3', $request->getClientIp());
1483+
$this->assertEquals('example.com', $request->getHost());
1484+
$this->assertEquals(80, $request->getPort());
1485+
$this->assertFalse($request->isSecure());
1486+
14801487
// trusted proxy via setTrustedProxies()
14811488
Request::setTrustedProxies(array('3.3.3.3', '2.2.2.2'));
14821489
$this->assertEquals('1.1.1.1', $request->getClientIp());

0 commit comments

Comments
 (0)