Skip to content

Commit

Permalink
Don't buffer things that shouldn't be buffered.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix committed Apr 6, 2024
1 parent bad7ff1 commit 46caa06
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion actionpack/lib/action_dispatch/http/response.rb
Expand Up @@ -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
Expand Down

0 comments on commit 46caa06

Please sign in to comment.