fix: correct checking the download size based on LimitedReader
This commit is contained in:
parent
48da5d3fd4
commit
d03a781e18
|
@ -1238,9 +1238,11 @@ func (s *S5API) pinEntity(ctx context.Context, userId uint, userIp string, cid *
|
|||
}
|
||||
|
||||
if !isCidManifest(cid) {
|
||||
if limitedReader.N >= 0 && uint64(len(data)) != cid.Size {
|
||||
if limitedReader.N > 0 {
|
||||
if uint64(len(data)) != cid.Size {
|
||||
return nil, false
|
||||
}
|
||||
}
|
||||
} else {
|
||||
dataCont, err := io.ReadAll(res.Body)
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in New Issue