aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean Griffin <sean@seantheprogrammer.com>2017-07-18 14:00:10 -0400
committerGitHub <noreply@github.com>2017-07-18 14:00:10 -0400
commite108a082df8bd815901b26525620f3d3d7ba0e10 (patch)
tree68850c96759bb256b897a2ae9441d0b18a45bff5
parenta12ce5d44782d08211fd6bbb9919207d9106f63a (diff)
parent235a0b5a5a7930bf20b66128496ee082ee76f6c9 (diff)
downloadrails-e108a082df8bd815901b26525620f3d3d7ba0e10.tar.gz
rails-e108a082df8bd815901b26525620f3d3d7ba0e10.tar.bz2
rails-e108a082df8bd815901b26525620f3d3d7ba0e10.zip
Merge pull request #29775 from yui-knk/assign_once
Assign `content_type` only once
-rw-r--r--actionpack/lib/action_controller/metal/data_streaming.rb4
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)