diff options
author | Samuel Giddins <segiddins@segiddins.me> | 2016-01-22 19:25:20 -0600 |
---|---|---|
committer | Samuel Giddins <segiddins@segiddins.me> | 2016-01-25 10:49:51 -0600 |
commit | f26a4fa1599384a3af17c237487ff67b07b876ce (patch) | |
tree | f655688b9832ad767c0f072b72899e561216c2ad | |
parent | 32595930a639549cbf6aa523ee831a3d51209150 (diff) | |
download | bundler-f26a4fa1599384a3af17c237487ff67b07b876ce.tar.gz |
[Updater] Simplify content logic
-rw-r--r-- | lib/bundler/vendor/compact_index_client/lib/compact_index_client/updater.rb | 5 |
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 7444bee4..a3cdc551 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" |