mirror of
https://github.com/minio/minio.git
synced 2025-11-09 05:34:56 -05:00
fix: do not list delete-marked objects (#13864)
delete marked objects should not be considered for listing when listing is delimited, this issue as introduced in PR #13804 which was mainly to address listing of directories in listing when delimited. This PR fixes this properly and adds tests to ensure that we behave in accordance with how an S3 API behaves for ListObjects() without versions.
This commit is contained in:
@@ -1118,15 +1118,12 @@ func (z *erasureServerPools) ListObjects(ctx context.Context, bucket, prefix, ma
|
||||
}
|
||||
|
||||
opts := listPathOptions{
|
||||
Bucket: bucket,
|
||||
Prefix: prefix,
|
||||
Separator: delimiter,
|
||||
Limit: maxKeysPlusOne(maxKeys, marker != ""),
|
||||
Marker: marker,
|
||||
// When delimiter is set make sure to include delete markers
|
||||
// necessary to capture proper CommonPrefixes as expected
|
||||
// in the response as per AWS S3.
|
||||
InclDeleted: delimiter != "",
|
||||
Bucket: bucket,
|
||||
Prefix: prefix,
|
||||
Separator: delimiter,
|
||||
Limit: maxKeysPlusOne(maxKeys, marker != ""),
|
||||
Marker: marker,
|
||||
InclDeleted: false,
|
||||
AskDisks: globalAPIConfig.getListQuorum(),
|
||||
}
|
||||
merged, err := z.listPath(ctx, &opts)
|
||||
|
||||
Reference in New Issue
Block a user