From 02a072734906ac4c1ea77990207b84895ab4a7cb Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 9 Jun 2015 20:17:18 +0000 Subject: ensure body is closed during hijack Middlewares such as Rack::Lock (used by Rails) break badly unless the response body is closed on hijack, so we will close it to follow the lead of other popular Rack servers. While it's unclear if there's anybody using rack.hijack with unicorn, we'll try to emulate the behavior of other servers as much as possible. ref: https://github.com/ngauthier/tubesock/issues/10 --- test/unit/test_response.rb | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'test') diff --git a/test/unit/test_response.rb b/test/unit/test_response.rb index d0f0c79..3478288 100644 --- a/test/unit/test_response.rb +++ b/test/unit/test_response.rb @@ -72,17 +72,6 @@ class ResponseTest < Test::Unit::TestCase assert ! out.closed? end - def test_body_closed - expect_body = %w(1 2 3 4).join("\n") - body = StringIO.new(expect_body) - body.rewind - out = StringIO.new - http_response_write(out,200, {}, body) - assert ! out.closed? - assert body.closed? - assert_match(expect_body, out.string.split(/\r\n/).last) - end - def test_unknown_status_pass_through out = StringIO.new http_response_write(out,"666 I AM THE BEAST", {}, [] ) -- cgit v1.2.3-24-ge0c7