instance method
local?
Ruby on Rails 3.0.20
Since v3.0.20Signature
local?()
True if the request came from localhost, 127.0.0.1.
Source
# File actionpack/lib/action_dispatch/http/request.rb, line 257
def local?
LOCALHOST.any? { |local_ip| local_ip === remote_addr && local_ip === remote_ip }
end
Defined in actionpack/lib/action_dispatch/http/request.rb line 257
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionDispatch::Request