diff options
| author | Giovanni Tirloni <gtirloni@tirloni.net> | 2026-01-27 15:04:30 -0300 |
|---|---|---|
| committer | git <svn-admin@ruby-lang.org> | 2026-02-04 09:50:27 +0000 |
| commit | 1258992bdff8818d3ce868e98ccc3496069d996d (patch) | |
| tree | 7614b7a4bd2d2e129ef2f3dea6d7cf4f585230c6 /test/testunit/runit/test_assert.rb | |
| parent | 9cc2242ee269fcb4d1fd10887a8270c59eb161fc (diff) | |
When a Range request returns 416 (Range Not Satisfiable), the recovery
path manually added an "Accept-Encoding: gzip" header before retrying.
This bypasses Ruby's automatic gzip decompression mechanism.
Ruby's Net::HTTP only sets decode_content=true (enabling automatic
decompression) when Accept-Encoding is NOT present in the request
headers. By manually setting this header, the decode_content flag
remained false, causing gzip-compressed response bodies to be written
directly to the compact index cache without decompression.
This resulted in "ArgumentError: invalid byte sequence in UTF-8" errors
when the corrupted cache was later read and parsed as text.
The fix removes the explicit Accept-Encoding header, allowing Ruby's
Net::HTTP to handle gzip compression transparently (as it does for all
other requests). Ruby will still add Accept-Encoding: gzip automatically
AND properly set decode_content=true for automatic decompression.
Fixes https://github.com/ruby/rubygems/pull/9271
https://github.com/ruby/rubygems/commit/b48b090e38
Diffstat (limited to 'test/testunit/runit/test_assert.rb')
0 files changed, 0 insertions, 0 deletions
