Improve ListObject Compatibility (#18099)

Do not error out when a provided marker is before or after the prefix, but instead just ignore it if before and return an empty list when after.

Fixes #18093
This commit is contained in:
Klaus Post
2023-09-25 08:13:08 -07:00
committed by GitHub
parent 57f84a8b4c
commit 21e8e071d7
7 changed files with 56 additions and 75 deletions

View File

@@ -1051,12 +1051,11 @@ func testListMultipartUploads(obj ObjectLayer, instanceType string, t TestErrHan
// Valid, existing bucket, delimiter not supported, returns empty values (Test number 8-9).
{bucketNames[0], "", "", "", "*", 0, ListMultipartsInfo{Delimiter: "*"}, nil, true},
{bucketNames[0], "", "", "", "-", 0, ListMultipartsInfo{Delimiter: "-"}, nil, true},
// Testing for failure cases with both perfix and marker (Test number 10).
// The prefix and marker combination to be valid it should satisfy strings.HasPrefix(marker, prefix).
// If marker is *after* the last possible object from the prefix it should return an empty list.
{
bucketNames[0], "asia", "europe-object", "", "", 0,
ListMultipartsInfo{},
fmt.Errorf("Invalid combination of marker '%s' and prefix '%s'", "europe-object", "asia"), false,
bucketNames[0], "Asia", "europe-object", "", "", 0,
ListMultipartsInfo{KeyMarker: "europe-object", Prefix: "Asia", IsTruncated: false},
nil, true,
},
// Setting an invalid combination of uploadIDMarker and Marker (Test number 11-12).
{