set storage class in FS mode (#5779)

This change sets the storage class of the object-info if a storage
class was specified during PUT. The server now replies with the
storage class which was set during uploading the object in FS mode.

Fixes #5777
This commit is contained in:
Andreas Auernhammer 2018-04-06 17:20:02 +02:00 committed by Nitish Tiwari
parent c30f75de28
commit 2f20d90465
1 changed files with 5 additions and 1 deletions

View File

@ -166,10 +166,14 @@ func (m fsMetaV1) ToObjectInfo(bucket, object string, fi os.FileInfo) ObjectInfo
} }
} }
// Extract etag from metadata.
objInfo.ETag = extractETag(m.Meta) objInfo.ETag = extractETag(m.Meta)
objInfo.ContentType = m.Meta["content-type"] objInfo.ContentType = m.Meta["content-type"]
objInfo.ContentEncoding = m.Meta["content-encoding"] objInfo.ContentEncoding = m.Meta["content-encoding"]
if storageClass, ok := m.Meta[amzStorageClass]; ok {
objInfo.StorageClass = storageClass
} else {
objInfo.StorageClass = globalMinioDefaultStorageClass
}
// etag/md5Sum has already been extracted. We need to // etag/md5Sum has already been extracted. We need to
// remove to avoid it from appearing as part of // remove to avoid it from appearing as part of