Problem
downloadChunkWithContext reads the entire response body into memory with no cap (downloader.go:153-158).
Impact
- OOM risk on servers that stream an unbounded body.
- This is also the clean fix for the two silent-corruption bugs: capping the read with
io.LimitReader(resp.Body, ChunkSize+1)and erroring on overflow catches both a Range-ignoring200(full body) and an oversized206.
Suggested fix
io.LimitReader(resp.Body, d.ChunkSize+1); if more bytes arrive than requested, fail the chunk.