fix: translate empty versionID string to null version where appropriate (#11629)

We store the null version as empty string. We should translate it to null
version for bucket with version suspended too.
This commit is contained in:
Krishnan Parthasarathi 2021-02-24 18:39:10 -08:00 committed by GitHub
parent b23659927c
commit ca5c6e3160
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -102,7 +102,7 @@ func (fi FileInfo) IsValid() bool {
func (fi FileInfo) ToObjectInfo(bucket, object string) ObjectInfo {
object = decodeDirObject(object)
versionID := fi.VersionID
if globalBucketVersioningSys.Enabled(bucket) && versionID == "" {
if (globalBucketVersioningSys.Enabled(bucket) || globalBucketVersioningSys.Suspended(bucket)) && versionID == "" {
versionID = nullVersionID
}