mirror of https://github.com/minio/minio.git
xl: Fix GET of an empty multiparted object (#3646)
GetObject returns unsatisfied range error when we try to download an object uploaded using multipart mechanism.
This commit is contained in:
parent
02194ee3c6
commit
e1bc99e4fe
|
@ -198,8 +198,14 @@ func (xl xlObjects) GetObject(bucket, object string, startOffset int64, length i
|
|||
return traceError(InvalidRange{startOffset, length, xlMeta.Stat.Size})
|
||||
}
|
||||
|
||||
// Calculate endOffset according to length
|
||||
endOffset := startOffset
|
||||
if length > 0 {
|
||||
endOffset += length - 1
|
||||
}
|
||||
|
||||
// Get last part index to read given length.
|
||||
lastPartIndex, _, err := xlMeta.ObjectToPartOffset(startOffset + length - 1)
|
||||
lastPartIndex, _, err := xlMeta.ObjectToPartOffset(endOffset)
|
||||
if err != nil {
|
||||
return traceError(InvalidRange{startOffset, length, xlMeta.Stat.Size})
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue