module RackCustomProxies::ClassMethods

Public Instance Methods

trusted_proxies() click to toggle source
# File lib/rack-custom-proxies.rb, line 3
def trusted_proxies
  @trusted_proxies ||= begin
    set = ENV['RACK_TRUSTED_PROXIES'] || "127.0.0.1/32 ::1"
    set.split(/\s+/).map { |i| IPAddr.new(i) }
  end
end