Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

If content_type is explicitly passed to the :head method use the valu…

…e or fallback
  • Loading branch information...
commit 3ca28dec0f5a4c41816f187dc31a922be5ebff89 1 parent c52ba1b
@whistlerbrk authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  actionpack/lib/action_controller/metal/head.rb
View
3  actionpack/lib/action_controller/metal/head.rb
@@ -20,6 +20,7 @@ def head(status, options = {})
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
@@ -29,7 +30,7 @@ def head(status, options = {})
self.location = url_for(location) if location
if include_content_headers?(self.status)
- self.content_type = Mime[formats.first] if formats
+ self.content_type = content_type || (Mime[formats.first] if formats)
else
headers.delete('Content-Type')
headers.delete('Content-Length')
Please sign in to comment.
Something went wrong with that request. Please try again.