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