-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove to_ary
from Response
#1453
Conversation
Responses are not arrays, so we should not allow them to be implicitly coerced to an array. If you would like you response to be converted to an array, you must explicitly do it with the `to_a` method. This also prevents creation of unnecessary body proxies
I was able to confirm that without removing this line the |
Looks like this will break Grape, ruby-grape/grape#1955. I haven't dug deep here, @dnesteryuk can probably provide an explanation. |
It does indeed break Grape; This issue explains the effect on Grape: ruby-grape/grape#1966 |
Not calling #finish worked up until rack 2.1.0: rack/rack@72959eb rack/rack#1453 https://github.com/rack/rack/blob/v2.2.2/lib/rack/response.rb#L6-L17 Response#finish has always been there: rack/rack@7ed819a#diff-10b933d2c1fdc82ceecade456c64e1c2
Responses are not arrays, so we should not allow them to be implicitly
coerced to an array. If you would like you response to be converted to
an array, you must explicitly do it with the
to_a
method.This also prevents creation of unnecessary body proxies
refs #419