Skip to content

Instantly share code, notes, and snippets.

@babatakao
Created October 30, 2012 11:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save babatakao/3979673 to your computer and use it in GitHub Desktop.
Save babatakao/3979673 to your computer and use it in GitHub Desktop.
Rails 3.2でproduction環境の時にHEADメソッド(request.head?)が動作しない不具合を修正するパッチ
# This file is used by Rack-based servers to start the application.
class SaveOriginalHttpMethod
def initialize(app)
@app = app
end
def call(env)
env['rack.methodoverride.original_method'] = env['REQUEST_METHOD']
@app.call(env)
end
end
use SaveOriginalHttpMethod
require ::File.expand_path('../config/environment', __FILE__)
run MyApp::Application
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment