aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/request.rb
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2004-12-07 10:50:26 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2004-12-07 10:50:26 +0000
commit94921293dbdbdf7fe49023fe7ed8908e05d3615f (patch)
tree7c439e1557e9971ab2ea4b64799823be5791ae6c /actionpack/lib/action_controller/request.rb
parent3e7d191e6450a3050976c735b0efc11b8a0aee93 (diff)
downloadrails-94921293dbdbdf7fe49023fe7ed8908e05d3615f.tar.gz
rails-94921293dbdbdf7fe49023fe7ed8908e05d3615f.tar.bz2
rails-94921293dbdbdf7fe49023fe7ed8908e05d3615f.zip
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
Diffstat (limited to 'actionpack/lib/action_controller/request.rb')
-rwxr-xr-xactionpack/lib/action_controller/request.rb4
1 files changed, 4 insertions, 0 deletions
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