From 3692f708caa5b39ff9f10700b517c4894afd740c Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Fri, 25 Sep 2020 18:00:58 +0300 Subject: [PATCH] [#51] object/put: Fix incorrect splited object streaming Signed-off-by: Leonard Lyubich --- pkg/services/object/put/remote.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/services/object/put/remote.go b/pkg/services/object/put/remote.go index ebd550cfe..d444ec0d7 100644 --- a/pkg/services/object/put/remote.go +++ b/pkg/services/object/put/remote.go @@ -1,6 +1,7 @@ package putsvc import ( + "bytes" "context" "crypto/ecdsa" @@ -42,7 +43,8 @@ func (t *remoteTarget) Close() (*transformer.AccessIdentifiers, error) { id, err := c.PutObject(t.ctx, new(client.PutObjectParams). WithObject( t.obj.SDK(), - ), + ). + WithPayloadReader(bytes.NewReader(t.obj.GetPayload())), client.WithTTL(1), // FIXME: use constant ) if err != nil {