Class: WebConsole::Request::GetSecureIp
- Inherits:
-
ActionDispatch::RemoteIp::GetIp
- Object
- ActionDispatch::RemoteIp::GetIp
- WebConsole::Request::GetSecureIp
- Defined in:
- lib/web_console/request.rb
Instance Method Summary collapse
- #filter_proxies(ips) ⇒ Object
-
#initialize(req, proxies) ⇒ GetSecureIp
constructor
A new instance of GetSecureIp.
Constructor Details
#initialize(req, proxies) ⇒ GetSecureIp
Returns a new instance of GetSecureIp.
32 33 34 35 36 37 38 39 40 41 |
# File 'lib/web_console/request.rb', line 32 def initialize(req, proxies) # After rails/rails@07b2ff0 ActionDispatch::RemoteIp::GetIp initializes # with a ActionDispatch::Request object instead of plain Rack # environment hash. Keep both @req and @env here, so we don't if/else # on Rails versions. @req = req @env = req.env @check_ip = true @proxies = proxies end |
Instance Method Details
#filter_proxies(ips) ⇒ Object
43 44 45 46 47 |
# File 'lib/web_console/request.rb', line 43 def filter_proxies(ips) ips.reject do |ip| @proxies.include?(ip) end end |