From 53468cc11147b0d285fc376fc546b677dad600ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Mon, 1 Feb 2021 16:17:16 +0100 Subject: Sync latest development version of bundler & rubygems --- lib/bundler/compact_index_client/updater.rb | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'lib/bundler/compact_index_client/updater.rb') diff --git a/lib/bundler/compact_index_client/updater.rb b/lib/bundler/compact_index_client/updater.rb index 66d1735583..9e0180fac7 100644 --- a/lib/bundler/compact_index_client/updater.rb +++ b/lib/bundler/compact_index_client/updater.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true require_relative "../vendored_fileutils" -require "stringio" -require "zlib" module Bundler class CompactIndexClient @@ -45,24 +43,18 @@ module Bundler else "bytes=#{local_temp_path.size}-" end - else - # Fastly ignores Range when Accept-Encoding: gzip is set - headers["Accept-Encoding"] = "gzip" end response = @fetcher.call(remote_path, headers) return nil if response.is_a?(Net::HTTPNotModified) content = response.body - if response["Content-Encoding"] == "gzip" - content = Zlib::GzipReader.new(StringIO.new(content)).read - end SharedHelpers.filesystem_access(local_temp_path) do if response.is_a?(Net::HTTPPartialContent) && local_temp_path.size.nonzero? local_temp_path.open("a") {|f| f << slice_body(content, 1..-1) } else - local_temp_path.open("w") {|f| f << content } + local_temp_path.open("wb") {|f| f << content } end end -- cgit v1.2.3