summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/net/http/response.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/net/http/response.rb b/lib/net/http/response.rb
index da3e4b4c8c..33a7804cdc 100644
--- a/lib/net/http/response.rb
+++ b/lib/net/http/response.rb
@@ -259,7 +259,12 @@ class Net::HTTPResponse
begin
yield inflate_body_io
ensure
- inflate_body_io.finish
+ e = $!
+ begin
+ inflate_body_io.finish
+ rescue
+ raise e
+ end
end
when 'none', 'identity' then
self.delete 'content-encoding'