File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
src/Symfony/Component/HttpFoundation/Tests Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -1477,6 +1477,13 @@ public function testTrustedProxies()
1477
1477
$ this ->assertEquals (80 , $ request ->getPort ());
1478
1478
$ this ->assertFalse ($ request ->isSecure ());
1479
1479
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
+
1480
1487
// trusted proxy via setTrustedProxies()
1481
1488
Request::setTrustedProxies (array ('3.3.3.3 ' , '2.2.2.2 ' ));
1482
1489
$ this ->assertEquals ('1.1.1.1 ' , $ request ->getClientIp ());
You can’t perform that action at this time.
0 commit comments