mirror of
https://github.com/minio/minio.git
synced 2025-11-20 18:06:10 -05:00
fix: consider partNumber in GET/HEAD requests (#10618)
This commit is contained in:
@@ -562,6 +562,15 @@ type ObjReaderFn func(inputReader io.Reader, h http.Header, pcfn CheckPreconditi
|
||||
func NewGetObjectReader(rs *HTTPRangeSpec, oi ObjectInfo, opts ObjectOptions, cleanUpFns ...func()) (
|
||||
fn ObjReaderFn, off, length int64, err error) {
|
||||
|
||||
if rs == nil && opts.PartNumber > 0 {
|
||||
var start, end int64
|
||||
for i := 0; i < len(oi.Parts) && i < opts.PartNumber; i++ {
|
||||
start = end
|
||||
end = start + oi.Parts[i].ActualSize - 1
|
||||
}
|
||||
rs = &HTTPRangeSpec{Start: start, End: end}
|
||||
}
|
||||
|
||||
// Call the clean-up functions immediately in case of exit
|
||||
// with error
|
||||
defer func() {
|
||||
|
||||
Reference in New Issue
Block a user