Skip to content

Commit

Permalink
[HttpFoundation] added some unit tests for ranges of trusted IP addre…
Browse files Browse the repository at this point in the history
…sses
  • Loading branch information
fabpot committed Apr 20, 2013
1 parent 811434f commit 1695067
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Symfony/Component/HttpFoundation/Tests/RequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -781,11 +781,15 @@ public function testGetClientIpsProvider()
array(array('88.88.88.88'), '127.0.0.1', '88.88.88.88', array('127.0.0.1')),
// forwarded for with remote IPv4 and all FF addrs trusted
array(array('88.88.88.88'), '127.0.0.1', '88.88.88.88', array('127.0.0.1', '88.88.88.88')),
// forwarded for with remote IPv4 range trusted
array(array('88.88.88.88'), '123.45.67.89', '88.88.88.88', array('123.45.67.0/24')),

// forwarded for with remote IPv6 addr not trusted
array(array('1620:0:1cfe:face:b00c::3'), '1620:0:1cfe:face:b00c::3', '2620:0:1cfe:face:b00c::3', null),
// forwarded for with remote IPv6 addr trusted
array(array('2620:0:1cfe:face:b00c::3'), '1620:0:1cfe:face:b00c::3', '2620:0:1cfe:face:b00c::3', array('1620:0:1cfe:face:b00c::3')),
// forwarded for with remote IPv6 range trusted
array(array('88.88.88.88'), '2a01:198:603:0:396e:4789:8e99:890f', '88.88.88.88', array('2a01:198:603:0::/65')),

// multiple forwarded for with remote IPv4 addr trusted
array(array('88.88.88.88', '87.65.43.21', '127.0.0.1'), '123.45.67.89', '127.0.0.1, 87.65.43.21, 88.88.88.88', array('123.45.67.89')),
Expand Down

0 comments on commit 1695067

Please sign in to comment.