Skip to content

Instantly share code, notes, and snippets.

@techiferous
Created November 15, 2009 06:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save techiferous/235042 to your computer and use it in GitHub Desktop.
Save techiferous/235042 to your computer and use it in GitHub Desktop.
module Rack
class Lockdown
def initialize(app)
@app = app
end
def call(env)
request = Rack::Request.new(env)
if ["GET", "HEAD"].include?(request.request_method)
@app.call(env)
else
message = "That action is currently not supported."
message << " We apologize for any inconvenience."
[405, {"Content-Type" => "text/html"}, message]
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment