Skip to content

Instantly share code, notes, and snippets.

@siannopollo
Created August 23, 2010 18:17
Show Gist options
  • Save siannopollo/546000 to your computer and use it in GitHub Desktop.
Save siannopollo/546000 to your computer and use it in GitHub Desktop.
require 'rack/utils'
class UnknownHttpMethodMiddleware
def initialize(app)
@app = app
end
def call(env)
return [401, {}, ''] if %w(connect).include?(env["REQUEST_METHOD"].downcase)
@app.call(env)
end
end
ActionController::Dispatcher.middleware.insert_before 0, UnknownHttpMethodMiddleware
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment