diff options
author | yui-knk <spiketeika@gmail.com> | 2017-07-13 12:03:12 +0900 |
---|---|---|
committer | yui-knk <spiketeika@gmail.com> | 2017-07-13 12:03:12 +0900 |
commit | 235a0b5a5a7930bf20b66128496ee082ee76f6c9 (patch) | |
tree | fb8ba1713b48868ffefb980b494c881b907091f1 /actionpack/lib/action_controller/metal/data_streaming.rb | |
parent | 58f10a31b37e9bb6e975a71aa63744f318ee043d (diff) | |
download | rails-235a0b5a5a7930bf20b66128496ee082ee76f6c9.tar.gz rails-235a0b5a5a7930bf20b66128496ee082ee76f6c9.tar.bz2 rails-235a0b5a5a7930bf20b66128496ee082ee76f6c9.zip |
Assign `content_type` only once
Diffstat (limited to 'actionpack/lib/action_controller/metal/data_streaming.rb')
-rw-r--r-- | actionpack/lib/action_controller/metal/data_streaming.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/actionpack/lib/action_controller/metal/data_streaming.rb b/actionpack/lib/action_controller/metal/data_streaming.rb index 3dbdd4a1b6..f839c6f4ce 100644 --- a/actionpack/lib/action_controller/metal/data_streaming.rb +++ b/actionpack/lib/action_controller/metal/data_streaming.rb @@ -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) |