aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorKunal Shah <me@kunalashah.com>2012-05-07 18:56:36 -0400
committerKunal Shah <me@kunalashah.com>2012-05-07 18:56:36 -0400
commit4d527387384cd1a27c2e079bbe1fd0f0505b8d17 (patch)
treec708127e1d75da36af79be53b309cb29f22cdbea /actionpack/lib
parent6f383482654fe071faaf3bafbadde2eb5bc091fd (diff)
downloadrails-4d527387384cd1a27c2e079bbe1fd0f0505b8d17.tar.gz
rails-4d527387384cd1a27c2e079bbe1fd0f0505b8d17.tar.bz2
rails-4d527387384cd1a27c2e079bbe1fd0f0505b8d17.zip
If content_type is explicitly passed to the :head method use the value or fallback
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_controller/metal/head.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/metal/head.rb b/actionpack/lib/action_controller/metal/head.rb
index a618533d09..671053566d 100644
--- a/actionpack/lib/action_controller/metal/head.rb
+++ b/actionpack/lib/action_controller/metal/head.rb
@@ -20,6 +20,7 @@ module ActionController
options, status = status, nil if status.is_a?(Hash)
status ||= options.delete(:status) || :ok
location = options.delete(:location)
+ content_type = options.delete(:content_type)
options.each do |key, value|
headers[key.to_s.dasherize.split('-').each { |v| v[0] = v[0].chr.upcase }.join('-')] = value.to_s
@@ -27,7 +28,7 @@ module ActionController
self.status = status
self.location = url_for(location) if location
- self.content_type = Mime[formats.first] if formats
+ self.content_type = content_type || (Mime[formats.first] if formats)
self.response_body = " "
end
end