提交 d1c6349e 编写于 作者: R Rick Olson

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
上级 b30de603
*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]
......
......@@ -943,19 +943,9 @@ def head(*args)
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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册