trusted_proxies.rb 417 B

12345678
  1. # frozen_string_literal: true
  2. unless Rails.application.config.action_dispatch.trusted_proxies.nil?
  3. # Rack is configured with a default collection of trusted proxies
  4. # If Rails has been configured to use a specific list, configure
  5. # Rack to use this Proc, which enforces the Rails-configured list.
  6. Rack::Request.ip_filter = ->(ip) { Rails.application.config.action_dispatch.trusted_proxies.include?(ip) }
  7. end