In the ActionController source, local requests are defined as follows:
def local_request? #:doc:
request.remote_addr == LOCALHOST && request.remote_ip == LOCALHOST
end
In my application, I want to use different logic if requests are coming from a particular IP range. What is the difference between request.remote_addr
and request.remote_ip
, and which one should I use?