From 2f20d904653d19733ac90d5f6c8f20458224e461 Mon Sep 17 00:00:00 2001 From: Andreas Auernhammer Date: Fri, 6 Apr 2018 17:20:02 +0200 Subject: [PATCH] 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 --- cmd/fs-v1-metadata.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmd/fs-v1-metadata.go b/cmd/fs-v1-metadata.go index 4c78ca9e1..04c802a8c 100644 --- a/cmd/fs-v1-metadata.go +++ b/cmd/fs-v1-metadata.go @@ -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.ContentType = m.Meta["content-type"] 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 // remove to avoid it from appearing as part of