summaryrefslogtreecommitdiff
path: root/lib/bundler/compact_index_client/updater.rb
diff options
context:
space:
mode:
authorMartin Emde <[email protected]>2025-02-21 17:57:16 -0800
committerHiroshi SHIBATA <[email protected]>2025-02-28 12:34:57 +0900
commit19bdcc8f0c1f08b60aa41044ba5b78b55a5c650e (patch)
tree010e4c048c9a9665474c65b98337701d7aa1a4f7 /lib/bundler/compact_index_client/updater.rb
parent223f37c00271001cc522cf00822bae6bbe7340ea (diff)
[rubygems/rubygems] Retry gracefully on blank partial response in compact index
https://github.com/rubygems/rubygems/commit/fafb9ae090
Diffstat (limited to 'lib/bundler/compact_index_client/updater.rb')
-rw-r--r--lib/bundler/compact_index_client/updater.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/bundler/compact_index_client/updater.rb b/lib/bundler/compact_index_client/updater.rb
index 88c7146900..6066fdc7c4 100644
--- a/lib/bundler/compact_index_client/updater.rb
+++ b/lib/bundler/compact_index_client/updater.rb
@@ -37,7 +37,8 @@ module Bundler
file.digests = parse_digests(response)
# server may ignore Range and return the full response
if response.is_a?(Gem::Net::HTTPPartialContent)
- break false unless file.append(response.body.byteslice(1..-1))
+ tail = response.body.byteslice(1..-1)
+ break false unless tail && file.append(tail)
else
file.write(response.body)
end