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