diff options
author | Martin Emde <[email protected]> | 2025-02-21 17:57:16 -0800 |
---|---|---|
committer | Hiroshi SHIBATA <[email protected]> | 2025-02-28 12:34:57 +0900 |
commit | 19bdcc8f0c1f08b60aa41044ba5b78b55a5c650e (patch) | |
tree | 010e4c048c9a9665474c65b98337701d7aa1a4f7 /lib/bundler/compact_index_client/updater.rb | |
parent | 223f37c00271001cc522cf00822bae6bbe7340ea (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.rb | 3 |
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 |