From 79b9a9ce468dcb4df9fa796ab3e7dc1d66ddb83e Mon Sep 17 00:00:00 2001 From: Kale Blankenship Date: Tue, 11 Dec 2018 17:30:15 -0800 Subject: [PATCH] Provide actual size in events instead of compressed size. (#6950) Previous behavior did not check if the object was compressed and incorrectly reported the stored size rather than the actual object size. --- cmd/notification.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmd/notification.go b/cmd/notification.go index b03a919e1..4027f3a2a 100644 --- a/cmd/notification.go +++ b/cmd/notification.go @@ -537,6 +537,9 @@ func (args eventArgs) ToEvent() event.Event { if args.EventName != event.ObjectRemovedDelete { newEvent.S3.Object.ETag = args.Object.ETag newEvent.S3.Object.Size = args.Object.Size + if args.Object.IsCompressed() { + newEvent.S3.Object.Size = args.Object.GetActualSize() + } newEvent.S3.Object.ContentType = args.Object.ContentType newEvent.S3.Object.UserMetadata = args.Object.UserDefined }