From c46dbb355b2b2218e4b0b2bcf1898e6d50f3a907 Mon Sep 17 00:00:00 2001 From: yui-knk Date: Thu, 13 Jul 2017 14:28:21 +0900 Subject: Brush up local variables assignment --- actionpack/lib/action_dispatch/http/response.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'actionpack') diff --git a/actionpack/lib/action_dispatch/http/response.rb b/actionpack/lib/action_dispatch/http/response.rb index 9b510d4ab9..d84f4701c6 100644 --- a/actionpack/lib/action_dispatch/http/response.rb +++ b/actionpack/lib/action_dispatch/http/response.rb @@ -257,11 +257,10 @@ module ActionDispatch # :nodoc: # response.charset = 'utf-16' # => 'utf-16' # response.charset = nil # => 'utf-8' def charset=(charset) - header_info = parsed_content_type_header + content_type = parsed_content_type_header.mime_type if false == charset - set_content_type header_info.mime_type, nil + set_content_type content_type, nil else - content_type = header_info.mime_type set_content_type content_type, charset || self.class.default_charset end end -- cgit v1.2.3