diff options
author | Peter Suschlik <ps@neopoly.de> | 2014-08-28 09:09:04 +0200 |
---|---|---|
committer | Peter Suschlik <ps@neopoly.de> | 2014-08-29 09:05:31 +0200 |
commit | a59a9b7f729870de6c9282bd8e2a7ed7f86fc868 (patch) | |
tree | 00501b74c4f518da4db1d736667538037df45e22 /actionpack/lib | |
parent | 0cc22f4b86e547880fb8f444b15f19bdb38c7bc9 (diff) | |
download | rails-a59a9b7f729870de6c9282bd8e2a7ed7f86fc868.tar.gz rails-a59a9b7f729870de6c9282bd8e2a7ed7f86fc868.tar.bz2 rails-a59a9b7f729870de6c9282bd8e2a7ed7f86fc868.zip |
Don't rescue IPAddr::InvalidAddressError
IPAddr::InvalidAddressError does not exist in Ruby 1.9.3
and fails for JRuby in 1.9 mode.
As IPAddr::InvalidAddressError is a subclass of ArgumentError
(via IPAddr::Error) just rescuing ArgumentError is fine.
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_dispatch/middleware/remote_ip.rb | 2 |
1 files changed, 1 insertions, 1 deletions
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 |