Be more explicit when wrapping in an enumerable body.

This commit is contained in:
Samuel Williams 2023-01-09 11:35:17 +13:00
parent 36e2cb9abb
commit 28c8e2229f
No known key found for this signature in database
GPG Key ID: A0765423A44728FB
1 changed files with 1 additions and 2 deletions

View File

@ -186,9 +186,8 @@ module ActionController
end
def response_body=(body)
body = [body] unless body.nil? || body.respond_to?(:each) || body.respond_to?(:call)
if body
body = [body] if body.is_a?(String)
response.body = body
super
else