Skip to content

Commit

Permalink
fix: only write out amount of bytes read for gzip (#203)
Browse files Browse the repository at this point in the history
Fixes a bug when pulling sdists where data from a previous chunk will be
written to the end of the final chunk, causing gzip to throw errors.

Co-authored-by: jacob.wiltse <[email protected]>
  • Loading branch information
Kelwing and JacobWiltseSAI authored Feb 8, 2024
1 parent ace6d2f commit 9f78ae0
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ impl StreamingOrLocal {
if bytes_read == 0 {
break;
}
local_file.write_all(&buf)?;
local_file.write_all(&buf[..bytes_read])?;
}

// Restart the file from the start so we can start reading from it.
Expand Down

0 comments on commit 9f78ae0

Please sign in to comment.