diff --git a/server/download.go b/server/download.go index db4d1f4e..5a735abf 100644 --- a/server/download.go +++ b/server/download.go @@ -221,7 +221,7 @@ func (b *blobDownload) downloadChunk(ctx context.Context, requestURL *url.URL, w } defer resp.Body.Close() - n, err := io.CopyN(w, io.TeeReader(resp.Body, part), part.Size) + n, err := io.CopyN(w, io.TeeReader(resp.Body, part), part.Size-part.Completed) if err != nil && !errors.Is(err, context.Canceled) && !errors.Is(err, io.ErrUnexpectedEOF) { // rollback progress b.Completed.Add(-n)