diff options
author | Eric Wong <e@80x24.org> | 2015-06-09 20:17:18 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2015-06-10 09:18:59 +0000 |
commit | 02a072734906ac4c1ea77990207b84895ab4a7cb (patch) | |
tree | 04abb7b53211c779637ab5a2f0e2930dbbd2ac6d /lib/unicorn/http_response.rb | |
parent | 40b9812029848933037466b2e7b19a47cfbd8363 (diff) | |
download | unicorn-02a072734906ac4c1ea77990207b84895ab4a7cb.tar.gz |
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
Diffstat (limited to 'lib/unicorn/http_response.rb')
-rw-r--r-- | lib/unicorn/http_response.rb | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/lib/unicorn/http_response.rb b/lib/unicorn/http_response.rb index 801bf9a..016dac8 100644 --- a/lib/unicorn/http_response.rb +++ b/lib/unicorn/http_response.rb @@ -52,12 +52,9 @@ module Unicorn::HttpResponse end if hijack - body = nil # ensure we do not close body hijack.call(socket) else body.each { |chunk| socket.write(chunk) } end - ensure - body.respond_to?(:close) and body.close end end |