From 069bc273853c90194606b1725113d77ae39e2edd Mon Sep 17 00:00:00 2001 From: Dan Kang Date: Sat, 8 Feb 2014 17:40:08 -0800 Subject: Prevent [response].flatten from recursing infinitely. Returning `self` from within the array returned by `to_ary` caused this. Instead, we can just substitute another object. It provides the `each` behavior required by the rack spec. --- actionpack/lib/action_dispatch/http/response.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionpack/lib/action_dispatch/http/response.rb') diff --git a/actionpack/lib/action_dispatch/http/response.rb b/actionpack/lib/action_dispatch/http/response.rb index bc13ee00f1..2c6bcf7b7b 100644 --- a/actionpack/lib/action_dispatch/http/response.rb +++ b/actionpack/lib/action_dispatch/http/response.rb @@ -313,7 +313,7 @@ module ActionDispatch # :nodoc: header.delete CONTENT_TYPE [status, header, []] else - [status, header, self] + [status, header, Rack::BodyProxy.new(self){}] end end end -- cgit v1.2.3