From 449039a86d802871b707dfb51ac1ed96d53526f9 Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Mon, 23 Jul 2012 13:50:48 -0300 Subject: Remove ActionDispatch::Head middleware in favor of Rack::Head Closes #7110 there's more work to do on rack-cache issue 69 --- actionpack/lib/action_dispatch/http/request.rb | 4 ++-- actionpack/lib/action_dispatch/middleware/head.rb | 18 ------------------ 2 files changed, 2 insertions(+), 20 deletions(-) delete mode 100644 actionpack/lib/action_dispatch/middleware/head.rb (limited to 'actionpack/lib/action_dispatch') diff --git a/actionpack/lib/action_dispatch/http/request.rb b/actionpack/lib/action_dispatch/http/request.rb index 8cea17c7a6..1377e53ce8 100644 --- a/actionpack/lib/action_dispatch/http/request.rb +++ b/actionpack/lib/action_dispatch/http/request.rb @@ -119,9 +119,9 @@ module ActionDispatch end # Is this a HEAD request? - # Equivalent to request.method_symbol == :head. + # Equivalent to request.request_method_symbol == :head. def head? - HTTP_METHOD_LOOKUP[method] == :head + HTTP_METHOD_LOOKUP[request_method] == :head end # Provides access to the request's HTTP headers, for example: diff --git a/actionpack/lib/action_dispatch/middleware/head.rb b/actionpack/lib/action_dispatch/middleware/head.rb deleted file mode 100644 index f1906a3ab3..0000000000 --- a/actionpack/lib/action_dispatch/middleware/head.rb +++ /dev/null @@ -1,18 +0,0 @@ -module ActionDispatch - class Head - def initialize(app) - @app = app - end - - def call(env) - if env["REQUEST_METHOD"] == "HEAD" - env["REQUEST_METHOD"] = "GET" - env["rack.methodoverride.original_method"] = "HEAD" - status, headers, _ = @app.call(env) - [status, headers, []] - else - @app.call(env) - end - end - end -end -- cgit v1.2.3