diff --git a/cmd/object-handlers.go b/cmd/object-handlers.go index 1236383d8..8f9425376 100644 --- a/cmd/object-handlers.go +++ b/cmd/object-handlers.go @@ -1312,6 +1312,7 @@ func (api objectAPIHandlers) PutObjectHandler(w http.ResponseWriter, r *http.Req if objectAPI.IsEncryptionSupported() { if crypto.IsEncrypted(objInfo.UserDefined) { + objInfo.Size, _ = objInfo.DecryptedSize() switch { case crypto.S3.IsEncrypted(objInfo.UserDefined): w.Header().Set(crypto.SSEHeader, crypto.SSEAlgorithmAES256) @@ -2347,6 +2348,11 @@ func (api objectAPIHandlers) CompleteMultipartUploadHandler(w http.ResponseWrite host, port = "", "" } + if objectAPI.IsEncryptionSupported() { + if crypto.IsEncrypted(objInfo.UserDefined) { + objInfo.Size, _ = objInfo.DecryptedSize() + } + } // Notify object created event. sendEvent(eventArgs{ EventName: event.ObjectCreatedCompleteMultipartUpload,