aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2014-05-01 14:43:14 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2014-05-01 14:43:14 -0300
commitb638c1a0b387d49cd3ec0c753dae21387481c290 (patch)
treeb4c1aa60e0822e0eae72b1d7252050b5ec61f40e /actionpack/test
parentc42aeace12a0e6e9b4e3bea3770f906884cc5b21 (diff)
parentcd78d725263b24ba33c1a5ec7b82f9576419f5d1 (diff)
downloadrails-b638c1a0b387d49cd3ec0c753dae21387481c290.tar.gz
rails-b638c1a0b387d49cd3ec0c753dae21387481c290.tar.bz2
rails-b638c1a0b387d49cd3ec0c753dae21387481c290.zip
Merge pull request #12651 from cespare/ipv6-remote-ip-fixes
Make remote_ip detection properly handle private IPv6 addresses Conflicts: actionpack/CHANGELOG.md
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/dispatch/request_test.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/actionpack/test/dispatch/request_test.rb b/actionpack/test/dispatch/request_test.rb
index 6e21b4a258..b48e8ab974 100644
--- a/actionpack/test/dispatch/request_test.rb
+++ b/actionpack/test/dispatch/request_test.rb
@@ -152,9 +152,12 @@ class RequestIP < BaseRequestTest
request = stub_request 'HTTP_X_FORWARDED_FOR' => 'unknown,::1'
assert_equal nil, request.remote_ip
- request = stub_request 'HTTP_X_FORWARDED_FOR' => '2001:0db8:85a3:0000:0000:8a2e:0370:7334, fe80:0000:0000:0000:0202:b3ff:fe1e:8329, ::1, fc00::'
+ request = stub_request 'HTTP_X_FORWARDED_FOR' => '2001:0db8:85a3:0000:0000:8a2e:0370:7334, fe80:0000:0000:0000:0202:b3ff:fe1e:8329, ::1, fc00::, fc01::, fdff'
assert_equal 'fe80:0000:0000:0000:0202:b3ff:fe1e:8329', request.remote_ip
+ request = stub_request 'HTTP_X_FORWARDED_FOR' => 'FE00::, FDFF::'
+ assert_equal 'FE00::', request.remote_ip
+
request = stub_request 'HTTP_X_FORWARDED_FOR' => 'not_ip_address'
assert_equal nil, request.remote_ip
end