mirror of
https://github.com/minio/minio.git
synced 2025-05-21 01:23:57 -04:00
Fix StorageClass field in ListObject/ListObjectV2 response (#5766)
Fixes: #5754
This commit is contained in:
parent
30ab71c9d9
commit
9eb94fe8c8
@ -339,7 +339,7 @@ func generateListObjectsV1Response(bucket, prefix, marker, delimiter string, max
|
|||||||
content.ETag = "\"" + object.ETag + "\""
|
content.ETag = "\"" + object.ETag + "\""
|
||||||
}
|
}
|
||||||
content.Size = object.Size
|
content.Size = object.Size
|
||||||
content.StorageClass = globalMinioDefaultStorageClass
|
content.StorageClass = object.StorageClass
|
||||||
content.Owner = owner
|
content.Owner = owner
|
||||||
contents = append(contents, content)
|
contents = append(contents, content)
|
||||||
}
|
}
|
||||||
@ -385,7 +385,7 @@ func generateListObjectsV2Response(bucket, prefix, token, nextToken, startAfter,
|
|||||||
content.ETag = "\"" + object.ETag + "\""
|
content.ETag = "\"" + object.ETag + "\""
|
||||||
}
|
}
|
||||||
content.Size = object.Size
|
content.Size = object.Size
|
||||||
content.StorageClass = globalMinioDefaultStorageClass
|
content.StorageClass = object.StorageClass
|
||||||
content.Owner = owner
|
content.Owner = owner
|
||||||
contents = append(contents, content)
|
contents = append(contents, content)
|
||||||
}
|
}
|
||||||
|
@ -98,6 +98,9 @@ type ObjectInfo struct {
|
|||||||
// by the Content-Type header field.
|
// by the Content-Type header field.
|
||||||
ContentEncoding string
|
ContentEncoding string
|
||||||
|
|
||||||
|
// Specify object storage class
|
||||||
|
StorageClass string
|
||||||
|
|
||||||
// User-Defined metadata
|
// User-Defined metadata
|
||||||
UserDefined map[string]string
|
UserDefined map[string]string
|
||||||
|
|
||||||
|
@ -315,6 +315,13 @@ func (m xlMetaV1) ToObjectInfo(bucket, object string) ObjectInfo {
|
|||||||
// All the parts per object.
|
// All the parts per object.
|
||||||
objInfo.Parts = m.Parts
|
objInfo.Parts = m.Parts
|
||||||
|
|
||||||
|
// Update storage class
|
||||||
|
if sc, ok := m.Meta[amzStorageClass]; ok {
|
||||||
|
objInfo.StorageClass = sc
|
||||||
|
} else {
|
||||||
|
objInfo.StorageClass = globalMinioDefaultStorageClass
|
||||||
|
}
|
||||||
|
|
||||||
// Success.
|
// Success.
|
||||||
return objInfo
|
return objInfo
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user