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

remotes/1727458204337373841/tmp_refs/heads/signup-info-prompt
Eugen Rochko 2017-01-22 21:01:28 +01:00
parent 67befe5463
commit 61aee0006e
1 changed files with 7 additions and 0 deletions

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