Created
June 21, 2012 18:16
-
-
Save dannymcc/2967519 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ApplicationController < ActionController::Base | |
before_filter :protect | |
protect_from_forgery | |
def protect | |
@ips = ['127.0.0.1', '116.155.117.121'] | |
if not @ips.include? request.remote_ip | |
# Check for your subnet stuff here, for example | |
# if not request.remote_ip.include?('127.0,0') | |
render :text => "You are unauthorized" | |
return | |
end | |
end | |
end |
Thanks Casey, it still doesn't seem to be working. It's difficult to test locally though so I can't work out what's wrong!
What is the error being thrown?
…Sent from my iPhone
On Jun 22, 2012, at 6:46 AM, Danny ***@***.*** wrote:
Thanks Casey, it still doesn't seem to be working. It's difficult to test locally though so I can't work out what's wrong!
---
Reply to this email directly or view it on GitHub:
https://gist.github.com/2967519
My mistake, it was another issue showing the error.
Thanks!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
if !@ips.include?(request.remote_ip)