mirror of
https://github.com/minio/minio.git
synced 2024-12-23 21:55:53 -05:00
Layer LimitReader responsibly allowing sign verification to work (#2821)
This commit is contained in:
parent
ddeb8242d8
commit
83e6e1060e
@ -387,15 +387,16 @@ func (xl xlObjects) PutObjectPart(bucket, object, uploadID string, partID int, s
|
||||
// Initialize md5 writer.
|
||||
md5Writer := md5.New()
|
||||
|
||||
lreader := data
|
||||
// Limit the reader to its provided size > 0.
|
||||
if size > 0 {
|
||||
// This is done so that we can avoid erroneous clients sending
|
||||
// more data than the set content size.
|
||||
data = io.LimitReader(data, size)
|
||||
lreader = io.LimitReader(data, size)
|
||||
} // else we read till EOF.
|
||||
|
||||
// Construct a tee reader for md5sum.
|
||||
teeReader := io.TeeReader(data, md5Writer)
|
||||
teeReader := io.TeeReader(lreader, md5Writer)
|
||||
|
||||
// Erasure code data and write across all disks.
|
||||
sizeWritten, checkSums, err := erasureCreateFile(onlineDisks, minioMetaBucket, tmpPartPath, teeReader, xlMeta.Erasure.BlockSize, xl.dataBlocks, xl.parityBlocks, bitRotAlgo, xl.writeQuorum)
|
||||
|
Loading…
Reference in New Issue
Block a user