[#51] object/put: Fix incorrect splited object streaming

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2020-09-25 18:00:58 +03:00 committed by Alex Vanin
parent 1a169a1a9d
commit 3692f708ca

View file

@ -1,6 +1,7 @@
package putsvc package putsvc
import ( import (
"bytes"
"context" "context"
"crypto/ecdsa" "crypto/ecdsa"
@ -42,7 +43,8 @@ func (t *remoteTarget) Close() (*transformer.AccessIdentifiers, error) {
id, err := c.PutObject(t.ctx, new(client.PutObjectParams). id, err := c.PutObject(t.ctx, new(client.PutObjectParams).
WithObject( WithObject(
t.obj.SDK(), t.obj.SDK(),
), ).
WithPayloadReader(bytes.NewReader(t.obj.GetPayload())),
client.WithTTL(1), // FIXME: use constant client.WithTTL(1), // FIXME: use constant
) )
if err != nil { if err != nil {