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.
master
Kale Blankenship 6 years ago committed by kannappanr
parent b9b353db4b
commit 79b9a9ce46
  1. 3
      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
}

Loading…
Cancel
Save