1
0

trusted_proxies.rb 305 B

12345678910111213
  1. # frozen_string_literal: true
  2. module Rack
  3. class Request
  4. def trusted_proxy?(ip)
  5. if Rails.application.config.action_dispatch.trusted_proxies.nil?
  6. super
  7. else
  8. Rails.application.config.action_dispatch.trusted_proxies.any? { |proxy| proxy === ip }
  9. end
  10. end
  11. end
  12. end