提交 45f70dca 编写于 作者: C Carlos Antonio da Silva

Merge pull request #12123 from aredondo/master

Add regression test for IpSpoofAttackError issue

Closes #10780
......@@ -93,6 +93,14 @@ def url_for(options = {})
assert_equal '1.1.1.1', request.remote_ip
end
test "remote ip spoof protection ignores private addresses" do
request = stub_request 'HTTP_X_FORWARDED_FOR' => '172.17.19.51',
'HTTP_CLIENT_IP' => '172.17.19.51',
'REMOTE_ADDR' => '1.1.1.1',
'HTTP_X_BLUECOAT_VIA' => 'de462e07a2db325e'
assert_equal '1.1.1.1', request.remote_ip
end
test "remote ip v6" do
request = stub_request 'REMOTE_ADDR' => '2001:0db8:85a3:0000:0000:8a2e:0370:7334'
assert_equal '2001:0db8:85a3:0000:0000:8a2e:0370:7334', request.remote_ip
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册