about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--config/initializers/trusted_proxies.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/config/initializers/trusted_proxies.rb b/config/initializers/trusted_proxies.rb
index 27e9ee039..3c2afd8cd 100644
--- a/config/initializers/trusted_proxies.rb
+++ b/config/initializers/trusted_proxies.rb
@@ -1,7 +1,11 @@
 module Rack
   class Request
     def trusted_proxy?(ip)
-      Rails.application.config.action_dispatch.trusted_proxies.any? { |proxy| proxy === ip }
+      if Rails.application.config.action_dispatch.trusted_proxies.nil?
+        super
+      else
+        Rails.application.config.action_dispatch.trusted_proxies.any? { |proxy| proxy === ip }
+      end
     end
   end
 end