From 46caa06125d027b11fdd388ea3449e76ea4ff82d Mon Sep 17 00:00:00 2001 From: Samuel Williams Date: Sat, 6 Apr 2024 22:51:39 +1300 Subject: [PATCH] Don't buffer things that shouldn't be buffered. --- actionpack/lib/action_dispatch/http/response.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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