Created
March 2, 2012 20:18
-
-
Save jcalvert/1961003 to your computer and use it in GitHub Desktop.
Sinatra IP filter?
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
before do | |
unless ['10','192','127'].include? request.ip.to_s.gsub /(.*?)\..*/,'\\1' | |
halt(404, "Not found") #I should probably throw 403, but in this case it's sensitive and I'd rather make like a hole. | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment