streaming broken in rack >= 1.3.7 #615

wants to merge 1 commit into


None yet

2 participants


small commit that fixes streaming (for us) can repro by using included sample chat app in the sinatra codebase.

@tobowers tobowers Rack >= 1.3.7 returns a Rack::BodyProxy instead of Rack::Response and…
… breaks all sinatra streaming. This commit looks for either type.
@rkh rkh commented on the diff Jan 18, 2013
@@ -64,7 +64,7 @@ def accept_entry(entry)
class Response < Rack::Response
def body=(value)
- value = value.body while Rack::Response === value
+ value = value.body while (Rack::Response === value) or (defined?(Rack::BodyProxy) && Rack::BodyProxy === value)
rkh Jan 18, 2013 Sinatra member

This will skip potential callbacks on the proxy, won't it?

tobowers Jan 18, 2013

oh hrm... I guess I don't know well enough how this works... this fixed sinatra streaming for us and we don't see any issues, but there could be gaping holes I'm not thinking of.

rkh Jan 19, 2013 Sinatra member

Gonna have to play with this. I guess if you should for instance do a enable :lock you will run into a deadlock with this code.

@rkh rkh closed this Jan 26, 2013
@magnetised magnetised added a commit to magnetised/spontaneous that referenced this pull request Jun 27, 2014
@magnetised magnetised Fix Rack at 1.4.1 until Sinatra streaming is fixed f689f51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment