diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2013-10-03 10:27:58 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2013-10-03 10:27:58 -0700 |
commit | befeeb2d0aef8db4ba84d1e2fa0d273f8a111363 (patch) | |
tree | 70e00f8546f6bb7765474dd792c1d08ed7ecac19 /railties | |
parent | 5aee516b5edb49d7206cd9815c13a78b6b16c5d9 (diff) | |
parent | 83c4b0a7f977b75a9005ceb78d8a2a719392d904 (diff) | |
download | rails-befeeb2d0aef8db4ba84d1e2fa0d273f8a111363.tar.gz rails-befeeb2d0aef8db4ba84d1e2fa0d273f8a111363.tar.bz2 rails-befeeb2d0aef8db4ba84d1e2fa0d273f8a111363.zip |
Merge branch '3-2-stable' into 3-2-sec
* 3-2-stable:
make sure both headers are set before checking for ip spoofing
Move set_inverse_instance to association.build_record
Diffstat (limited to 'railties')
-rw-r--r-- | railties/test/application/middleware/remote_ip_test.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/railties/test/application/middleware/remote_ip_test.rb b/railties/test/application/middleware/remote_ip_test.rb index da291f061c..126f4832c4 100644 --- a/railties/test/application/middleware/remote_ip_test.rb +++ b/railties/test/application/middleware/remote_ip_test.rb @@ -46,6 +46,16 @@ module ApplicationTests end end + test "works with both headers individually" do + make_basic_app + assert_nothing_raised(ActionDispatch::RemoteIp::IpSpoofAttackError) do + assert_equal "1.1.1.1", remote_ip("HTTP_X_FORWARDED_FOR" => "1.1.1.1") + end + assert_nothing_raised(ActionDispatch::RemoteIp::IpSpoofAttackError) do + assert_equal "1.1.1.2", remote_ip("HTTP_CLIENT_IP" => "1.1.1.2") + end + end + test "can disable IP spoofing check" do make_basic_app do |app| app.config.action_dispatch.ip_spoofing_check = false |