fix: compute IsTruncated from the absolute index in ListMultipartUploads

With an upload-id-marker the lister ranges over Uploads[startIndex:],
but passed the index of that subslice to hasMoreAfter, which indexes
the full list. A page that ended on the last remaining upload was still
reported as truncated, with next markers pointing at that upload, so a
client had to make one more request to get an empty page.

Iterate over the full list from startIndex, so hasMoreAfter gets the
real position of the next upload.
This commit is contained in:
dualfroz committed 2026-10-05 20:25:15 +02:00
1 parent a4aa4bb8d2
commit 2f2ed7ae25
3 files changed
+58 -1

No files matched your search

+2 -1
View File
@@ -113,7 +113,8 @@ func (l *MultipartUploadLister) Run() (*ListMultipartUploadsPage, error) {
return emitted == l.MaxUploads
}
for i, up := range l.Uploads[startIndex:] {
for i := startIndex; i < len(l.Uploads); i++ {
up := l.Uploads[i]
if l.Delimiter != "" {
// delimiter check
suffix := strings.TrimPrefix(up.Key, l.Prefix)