Merge pull request #29775 from yui-knk/assign_once
Assign `content_type` only once
This commit is contained in:
commit
e108a082df
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue