encryption: Fix copy from encrypted multipart to single part (#6604)

CopyObject handler forgot to remove multipart encryption flag in metadata
when source is an encrypted multipart object and the target is also encrypted
but single part object.

This PR also simplifies the code to facilitate review.
This commit is contained in:
Anis Elleuch
2018-10-15 19:07:36 +01:00
committed by kannappanr
parent 3ef3fefd54
commit 5b3090dffc
4 changed files with 70 additions and 37 deletions
+2
View File
@@ -218,6 +218,8 @@ func (m xlMetaV1) ToObjectInfo(bucket, object string) ObjectInfo {
ContentEncoding: m.Meta["content-encoding"],
}
objInfo.backendType = BackendErasure
// Extract etag from metadata.
objInfo.ETag = extractETag(m.Meta)