aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorPeter Suschlik <ps@neopoly.de>2014-08-28 09:09:04 +0200
committerPeter Suschlik <ps@neopoly.de>2014-08-29 09:05:31 +0200
commita59a9b7f729870de6c9282bd8e2a7ed7f86fc868 (patch)
tree00501b74c4f518da4db1d736667538037df45e22 /actionpack
parent0cc22f4b86e547880fb8f444b15f19bdb38c7bc9 (diff)
downloadrails-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')
-rw-r--r--actionpack/CHANGELOG.md7
-rw-r--r--actionpack/lib/action_dispatch/middleware/remote_ip.rb2
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