闭社主体 forked from https://github.com/tootsuite/mastodon
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

11 lines
274 B

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