diff options
author | Yves Senn <yves.senn@gmail.com> | 2014-08-29 09:06:33 +0200 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2014-08-29 09:06:33 +0200 |
commit | 3cce387a1d9d276f984acad2c64f3df5a82ae631 (patch) | |
tree | 00501b74c4f518da4db1d736667538037df45e22 | |
parent | 0cc22f4b86e547880fb8f444b15f19bdb38c7bc9 (diff) | |
parent | a59a9b7f729870de6c9282bd8e2a7ed7f86fc868 (diff) | |
download | rails-3cce387a1d9d276f984acad2c64f3df5a82ae631.tar.gz rails-3cce387a1d9d276f984acad2c64f3df5a82ae631.tar.bz2 rails-3cce387a1d9d276f984acad2c64f3df5a82ae631.zip |
Merge pull request #16728 from splattael/invalid_address_error
Don't rescue IPAddr::InvalidAddressError
-rw-r--r-- | actionpack/CHANGELOG.md | 7 | ||||
-rw-r--r-- | actionpack/lib/action_dispatch/middleware/remote_ip.rb | 2 |
2 files changed, 8 insertions, 1 deletions
diff --git a/actionpack/CHANGELOG.md b/actionpack/CHANGELOG.md index 4e8e0f41b4..e250450a76 100644 --- a/actionpack/CHANGELOG.md +++ b/actionpack/CHANGELOG.md @@ -1,3 +1,10 @@ +* Don't rescue `IPAddr::InvalidAddressError`. + + `IPAddr::InvalidAddressError` does not exist in Ruby 1.9.3 + and fails for JRuby in 1.9 mode. + + *Peter Suschlik* + * Fix bug where the router would ignore any constraints added to redirect routes. diff --git a/actionpack/lib/action_dispatch/middleware/remote_ip.rb b/actionpack/lib/action_dispatch/middleware/remote_ip.rb index b022fea001..7c4236518d 100644 --- a/actionpack/lib/action_dispatch/middleware/remote_ip.rb +++ b/actionpack/lib/action_dispatch/middleware/remote_ip.rb @@ -155,7 +155,7 @@ module ActionDispatch range = IPAddr.new(ip).to_range # we want to make sure nobody is sneaking a netmask in range.begin == range.end - rescue ArgumentError, IPAddr::InvalidAddressError + rescue ArgumentError nil end end |