Skip to content

Instantly share code, notes, and snippets.

@ahoward
Created December 16, 2008 02:58
Show Gist options
  • Save ahoward/36240 to your computer and use it in GitHub Desktop.
Save ahoward/36240 to your computer and use it in GitHub Desktop.
# True if the request came from localhost, 127.0.0.1. Override this
# method if you wish to redefine the meaning of a local request to
# include remote IP addresses or other criteria.
def local_request? #:doc:
request.remote_addr == LOCALHOST && request.remote_ip == LOCALHOST
end
LOCALHOST = '127.0.0.1'.freeze
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment