summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Giddins <segiddins@segiddins.me>2016-01-22 19:25:20 -0600
committerSamuel Giddins <segiddins@segiddins.me>2016-01-25 10:49:51 -0600
commitf26a4fa1599384a3af17c237487ff67b07b876ce (patch)
treef655688b9832ad767c0f072b72899e561216c2ad
parent32595930a639549cbf6aa523ee831a3d51209150 (diff)
downloadbundler-f26a4fa1599384a3af17c237487ff67b07b876ce.tar.gz
[Updater] Simplify content logic
-rw-r--r--lib/bundler/vendor/compact_index_client/lib/compact_index_client/updater.rb5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/bundler/vendor/compact_index_client/lib/compact_index_client/updater.rb b/lib/bundler/vendor/compact_index_client/lib/compact_index_client/updater.rb
index 7444bee45c..a3cdc55140 100644
--- a/lib/bundler/vendor/compact_index_client/lib/compact_index_client/updater.rb
+++ b/lib/bundler/vendor/compact_index_client/lib/compact_index_client/updater.rb
@@ -23,10 +23,9 @@ class Bundler::CompactIndexClient
response = @fetcher.call(remote_path, headers)
return if response.is_a?(Net::HTTPNotModified)
+ content = response.body
if response["Content-Encoding"] == "gzip"
- content = Zlib::GzipReader.new(StringIO.new(response.body)).read
- else
- content = response.body
+ content = Zlib::GzipReader.new(StringIO.new(content)).read
end
mode = response.is_a?(Net::HTTPPartialContent) ? "a" : "w"