summaryrefslogtreecommitdiff
path: root/config/initializers/trusted_proxies.rb
diff options
context:
space:
mode:
Diffstat (limited to 'config/initializers/trusted_proxies.rb')
-rw-r--r--config/initializers/trusted_proxies.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/config/initializers/trusted_proxies.rb b/config/initializers/trusted_proxies.rb
index 30770b71e24..cd869657c53 100644
--- a/config/initializers/trusted_proxies.rb
+++ b/config/initializers/trusted_proxies.rb
@@ -7,6 +7,8 @@ module Rack
class Request
def trusted_proxy?(ip)
Rails.application.config.action_dispatch.trusted_proxies.any? { |proxy| proxy === ip }
+ rescue IPAddr::InvalidAddressError
+ false
end
end
end