Merge pull request #29775 from yui-knk/assign_once

Assign `content_type` only once
This commit is contained in:
Sean Griffin 2017-07-18 14:00:10 -04:00 committed by GitHub
commit e108a082df
1 changed files with 2 additions and 2 deletions

View File

@ -111,10 +111,10 @@ module ActionController #:nodoc:
def send_file_headers!(options)
type_provided = options.has_key?(:type)
self.content_type = DEFAULT_SEND_FILE_TYPE
content_type = options.fetch(:type, DEFAULT_SEND_FILE_TYPE)
self.content_type = content_type
response.sending_file = true
content_type = options.fetch(:type, DEFAULT_SEND_FILE_TYPE)
raise ArgumentError, ":type option required" if content_type.nil?
if content_type.is_a?(Symbol)