diff options
author | Santiago Pastorino <santiago@wyeworks.com> | 2012-12-31 15:08:00 -0200 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2012-12-31 15:08:00 -0200 |
commit | 348870d5c53c94eb02135c04297c18be60bd3bb0 (patch) | |
tree | 59773c8496352442f5ea67b817ab18d38e91fb63 /actionpack/lib/action_dispatch/http/response.rb | |
parent | e48dc194231830f42f179704596b88215f062c23 (diff) | |
download | rails-348870d5c53c94eb02135c04297c18be60bd3bb0.tar.gz rails-348870d5c53c94eb02135c04297c18be60bd3bb0.tar.bz2 rails-348870d5c53c94eb02135c04297c18be60bd3bb0.zip |
Revert "Merge pull request #8665 from senny/8661_should_not_append_charset_if_already_present"
This reverts commit e48dc194231830f42f179704596b88215f062c23, reversing
changes made to d38c8caa48a732d41c7402a5e71deece4e313559.
Diffstat (limited to 'actionpack/lib/action_dispatch/http/response.rb')
-rw-r--r-- | actionpack/lib/action_dispatch/http/response.rb | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/actionpack/lib/action_dispatch/http/response.rb b/actionpack/lib/action_dispatch/http/response.rb index 60d97c5e77..5797c63924 100644 --- a/actionpack/lib/action_dispatch/http/response.rb +++ b/actionpack/lib/action_dispatch/http/response.rb @@ -56,7 +56,7 @@ module ActionDispatch # :nodoc: CONTENT_TYPE = "Content-Type".freeze SET_COOKIE = "Set-Cookie".freeze LOCATION = "Location".freeze - + cattr_accessor(:default_charset) { "utf-8" } include Rack::Response::Helpers @@ -195,16 +195,12 @@ module ActionDispatch # :nodoc: return if headers[CONTENT_TYPE].present? @content_type ||= Mime::HTML - @charset ||= self.class.default_charset if !defined?(@charset) || @charset != false + @charset ||= self.class.default_charset type = @content_type.to_s.dup - type << "; charset=#{@charset}" if append_charset? + type << "; charset=#{@charset}" unless @sending_file headers[CONTENT_TYPE] = type end - - def append_charset? - !@sending_file && @charset != false - end end end |