method
assign_default_content_type_and_charset!
v4.2.1 -
Show latest stable
- Class:
ActionDispatch::Response
assign_default_content_type_and_charset!(headers)private
No documentation available.
# File actionpack/lib/action_dispatch/http/response.rb, line 340
def assign_default_content_type_and_charset!(headers)
return if headers[CONTENT_TYPE].present?
@content_type ||= Mime::HTML
@charset ||= self.class.default_charset unless @charset == false
type = @content_type.to_s.dup
type << "; charset=#{@charset}" if append_charset?
headers[CONTENT_TYPE] = type
end