summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2022-04-02 14:50:03 -0700
committergit <svn-admin@ruby-lang.org>2022-04-03 06:51:07 +0900
commit7648bae4c86121b0b259587da11d27297c248633 (patch)
treefe046c49ef1ad48bf3f7dd756fea6594f4780c7e /lib
parent7be4d900f0e14e6093c726fbc4416560fd56c931 (diff)
[ruby/net-http] Revert "Update the content-length heading when decoding bodies"
This reverts commit https://github.com/ruby/net-http/commit/a7cb30124cf1. This is causing errors in Ruby's CI, will revert for now and try again after testing a fix with Ruby's CI. https://github.com/ruby/net-http/commit/7b852b1feb
Diffstat (limited to 'lib')
-rw-r--r--lib/net/http/response.rb12
1 files changed, 0 insertions, 12 deletions
diff --git a/lib/net/http/response.rb b/lib/net/http/response.rb
index cbe16ca205..08eaeb2cac 100644
--- a/lib/net/http/response.rb
+++ b/lib/net/http/response.rb
@@ -263,7 +263,6 @@ class Net::HTTPResponse
case v&.downcase
when 'deflate', 'gzip', 'x-gzip' then
self.delete 'content-encoding'
- had_content_length = self.delete 'content-length'
inflate_body_io = Inflater.new(@socket)
@@ -273,9 +272,6 @@ class Net::HTTPResponse
ensure
begin
inflate_body_io.finish
- if had_content_length
- self['content-length'] = inflate_body_io.bytes_inflated.to_s
- end
rescue => err
# Ignore #finish's error if there is an exception from yield
raise err if success
@@ -378,14 +374,6 @@ class Net::HTTPResponse
end
##
- # The number of bytes inflated, used to update the Content-Length of
- # the response.
-
- def bytes_inflated
- @inflate.total_out
- end
-
- ##
# Returns a Net::ReadAdapter that inflates each read chunk into +dest+.
#
# This allows a large response body to be inflated without storing the