diff options
author | James Tucker <jftucker@gmail.com> | 2014-08-03 13:42:49 -0300 |
---|---|---|
committer | James Tucker <jftucker@gmail.com> | 2014-08-03 13:42:49 -0300 |
commit | 0f8cd0544cf40ef91a55d7762bcbaf3a360f97f9 (patch) | |
tree | 0e0f2ab998e13edb2878b1a85ef791268e0c09ca | |
parent | 5a9ffeb77c613e3611262f1182284f1d7df393a8 (diff) | |
download | rack-0f8cd0544cf40ef91a55d7762bcbaf3a360f97f9.tar.gz |
Fix yet another body close bug in Rack::Deflater
-rw-r--r-- | lib/rack/deflater.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/rack/deflater.rb b/lib/rack/deflater.rb index 2e55f97e..36cfb7af 100644 --- a/lib/rack/deflater.rb +++ b/lib/rack/deflater.rb @@ -58,9 +58,9 @@ module Rack when "identity" [status, headers, body] when nil - body.close if body.respond_to?(:close) message = "An acceptable encoding for the requested resource #{request.fullpath} could not be found." - [406, {"Content-Type" => "text/plain", "Content-Length" => message.length.to_s}, [message]] + bp = Rack::BodyProxy.new([message]) { body.close if body.respond_to?(:close) } + [406, {"Content-Type" => "text/plain", "Content-Length" => message.length.to_s}, bp] end end |