[PATCH] http_response: don't "rescue nil" for body.close

Eric Wong normalperson at yhbt.net
Wed Sep 9 15:53:23 EDT 2009

This can hide bugs in Rack applications/middleware.  Most other
Rack handlers/servers seem to follow this route as well, so
this helps ensure broken things will break loudly and more
consistently across all Rack-enabled servers :)

 This will be in the next release, so fix your applications/middleware
 before hand...

 lib/unicorn/http_response.rb |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/unicorn/http_response.rb b/lib/unicorn/http_response.rb
index e0ff805..0d05b2c 100644
--- a/lib/unicorn/http_response.rb
+++ b/lib/unicorn/http_response.rb
@@ -69,7 +69,7 @@ module Unicorn
       body.each { |chunk| socket.write(chunk) }
       socket.close # flushes and uncorks the socket immediately
-        body.respond_to?(:close) and body.close rescue nil
+        body.respond_to?(:close) and body.close
Eric Wong

More information about the mongrel-unicorn mailing list