fix: ListObjectsV2 for SSE S3 Gateway when maxKeys is 0

This commit is contained in:
Harshavardhana
2021-10-01 11:53:06 -07:00
parent bc6067d195
commit cfbaf7bf1c
2 changed files with 19 additions and 21 deletions

View File

@@ -113,7 +113,7 @@ func (l *s3EncObjects) ListObjectsV2(ctx context.Context, bucket, prefix, contin
} else {
objects = append(objects, obj)
}
if len(objects) > maxKeys {
if maxKeys > 0 && len(objects) > maxKeys {
break
}
}
@@ -130,7 +130,7 @@ func (l *s3EncObjects) ListObjectsV2(ctx context.Context, bucket, prefix, contin
prefixes = append(prefixes, p)
}
}
if (len(objects) > maxKeys) || !loi.IsTruncated {
if (maxKeys > 0 && len(objects) > maxKeys) || !loi.IsTruncated {
break
}
}