From 94921293dbdbdf7fe49023fe7ed8908e05d3615f Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Tue, 7 Dec 2004 10:50:26 +0000 Subject: Added indifference to whether @headers["Content-Type"], @headers["Content-type"], or @headers["content-type"] is used. Added proper handling of HEAD requests, so that content isnt returned (Request#head? added as well) #277 [Eric Hodel] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@57 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/lib/action_controller/request.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'actionpack/lib/action_controller/request.rb') diff --git a/actionpack/lib/action_controller/request.rb b/actionpack/lib/action_controller/request.rb index d58cf58543..9eb0b04ef0 100755 --- a/actionpack/lib/action_controller/request.rb +++ b/actionpack/lib/action_controller/request.rb @@ -26,6 +26,10 @@ module ActionController method == :delete end + def head? + method == :head + end + # Determine originating IP address. REMOTE_ADDR is the standard # but will fail if the user is behind a proxy. HTTP_CLIENT_IP and/or # HTTP_X_FORWARDED_FOR are set by proxies so check for these before -- cgit v1.2.3