fix: ListObjectVersions returning duplicates when resuming with null version id (#19518)

When resuming a versioned listing where `version-id-marker=null`, the `null` object would 
always be returned, causing duplicate entries to be returned.

Add check against empty version
This commit is contained in:
Klaus Post 2024-04-16 08:41:27 -07:00 committed by GitHub
parent 0cf3d93360
commit 9246990496
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -152,6 +152,15 @@ func (f *FileInfoVersions) findVersionIndex(v string) int {
if f == nil || v == "" {
return -1
}
if v == nullVersionID {
for i, ver := range f.Versions {
if ver.VersionID == "" {
return i
}
}
return -1
}
for i, ver := range f.Versions {
if ver.VersionID == v {
return i