Browse Source

Override Rack::Request to use the same trusted proxy settings as Rails

closed-social-glitch-2
Eugen Rochko 7 years ago
parent
commit
61aee0006e
1 changed files with 7 additions and 0 deletions
  1. +7
    -0
      config/initializers/trusted_proxies.rb

+ 7
- 0
config/initializers/trusted_proxies.rb View File

@ -0,0 +1,7 @@
module Rack
class Request
def trusted_proxy?(ip)
Rails.application.config.action_dispatch.trusted_proxies.any? { |proxy| proxy === ip }
end
end
end

Loading…
Cancel
Save