diff --git a/actionpack/lib/action_dispatch/http/response.rb b/actionpack/lib/action_dispatch/http/response.rb index e74363f6aafca..9b29c643d8cf7 100644 --- a/actionpack/lib/action_dispatch/http/response.rb +++ b/actionpack/lib/action_dispatch/http/response.rb @@ -325,7 +325,8 @@ def write(string) # Allows you to manually set or override the response body. def body=(body) - if body.respond_to?(:to_path) + # Don't buffer things that shouldn't be buffered: + if body.respond_to?(:to_path) or !body.respond_to?(:to_ary) @stream = body else synchronize do