diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2015-07-13 17:48:56 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2015-07-13 17:48:56 -0700 |
commit | b37e29ec2db099b68ac3d80d1119774ae3688757 (patch) | |
tree | 47d04b449fa5e73e8d8cc487a30374a5a07eb90a /actionpack/lib/action_controller | |
parent | 48609420b814a66d263e19dd95064186de57cc40 (diff) | |
download | rails-b37e29ec2db099b68ac3d80d1119774ae3688757.tar.gz rails-b37e29ec2db099b68ac3d80d1119774ae3688757.tar.bz2 rails-b37e29ec2db099b68ac3d80d1119774ae3688757.zip |
move buffer caching on to the buffer
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r-- | actionpack/lib/action_controller/metal/data_streaming.rb | 4 | ||||
-rw-r--r-- | actionpack/lib/action_controller/test_case.rb | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/actionpack/lib/action_controller/metal/data_streaming.rb b/actionpack/lib/action_controller/metal/data_streaming.rb index 1abd8d3a33..0abfd629aa 100644 --- a/actionpack/lib/action_controller/metal/data_streaming.rb +++ b/actionpack/lib/action_controller/metal/data_streaming.rb @@ -85,6 +85,10 @@ module ActionController #:nodoc: @to_path = path end + def body + File.binread(to_path) + end + # Stream the file's contents if Rack::Sendfile isn't present. def each File.open(to_path, 'rb') do |file| diff --git a/actionpack/lib/action_controller/test_case.rb b/actionpack/lib/action_controller/test_case.rb index 43c481339a..ad9836f122 100644 --- a/actionpack/lib/action_controller/test_case.rb +++ b/actionpack/lib/action_controller/test_case.rb @@ -136,10 +136,6 @@ module ActionController end class LiveTestResponse < Live::Response - def body - @body ||= super - end - # Was the response successful? alias_method :success?, :successful? |