aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorRick Olson <technoweenie@gmail.com>2007-12-08 19:23:03 +0000
committerRick Olson <technoweenie@gmail.com>2007-12-08 19:23:03 +0000
commitd1c6349e5872bcf5ce7fa1adcac76476fbe6fa78 (patch)
treeb2e6a42b381dcfb926160ece40e8bdfcd44046b4 /actionpack
parentb30de6039d85d5d8239b9fc500d88f56d52c8d8d (diff)
downloadrails-d1c6349e5872bcf5ce7fa1adcac76476fbe6fa78.tar.gz
rails-d1c6349e5872bcf5ce7fa1adcac76476fbe6fa78.tar.bz2
rails-d1c6349e5872bcf5ce7fa1adcac76476fbe6fa78.zip
Clean up some cruft around ActionController::Base#head. Closes #10417 [ssoroka]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8334 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/CHANGELOG4
-rwxr-xr-xactionpack/lib/action_controller/base.rb14
2 files changed, 6 insertions, 12 deletions
diff --git a/actionpack/CHANGELOG b/actionpack/CHANGELOG
index f9f3fe2cd1..696f2c8811 100644
--- a/actionpack/CHANGELOG
+++ b/actionpack/CHANGELOG
@@ -1,3 +1,7 @@
+*SVN*
+
+* Clean up some cruft around ActionController::Base#head. Closes #10417 [ssoroka]
+
*2.0.1* (December 7th, 2007)
* Fixed send_file/binary_content for testing #8044 [tolsen]
diff --git a/actionpack/lib/action_controller/base.rb b/actionpack/lib/action_controller/base.rb
index 0b467223ec..7cd7ebcfbb 100755
--- a/actionpack/lib/action_controller/base.rb
+++ b/actionpack/lib/action_controller/base.rb
@@ -943,19 +943,9 @@ module ActionController #:nodoc:
raise ArgumentError, "too many arguments to head"
elsif args.empty?
raise ArgumentError, "too few arguments to head"
- elsif args.length == 2
- status = args.shift
- options = args.shift
- elsif args.first.is_a?(Hash)
- options = args.first
- else
- status = args.first
- options = {}
end
-
- raise ArgumentError, "head requires an options hash" if !options.is_a?(Hash)
-
- status = interpret_status(status || options.delete(:status) || :ok)
+ options = args.extract_options!
+ status = interpret_status(args.shift || options.delete(:status) || :ok)
options.each do |key, value|
headers[key.to_s.dasherize.split(/-/).map { |v| v.capitalize }.join("-")] = value.to_s