From 00a17d8316cd9fc1c613a7e477b47ccdf631e968 Mon Sep 17 00:00:00 2001 From: Evgeniy Kulikov Date: Thu, 20 Aug 2020 02:31:04 +0300 Subject: [PATCH] CopyObject should contains custom headers Signed-off-by: Evgeniy Kulikov --- api/layer/layer.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/api/layer/layer.go b/api/layer/layer.go index 80a05b97..4cf5633b 100644 --- a/api/layer/layer.go +++ b/api/layer/layer.go @@ -10,6 +10,7 @@ import ( "github.com/nspcc-dev/neofs-api-go/object" "github.com/nspcc-dev/neofs-api-go/refs" "github.com/nspcc-dev/neofs-api-go/service" + "github.com/nspcc-dev/neofs-s3-gate/api" "github.com/nspcc-dev/neofs-s3-gate/api/pool" "github.com/pkg/errors" "go.uber.org/zap" @@ -44,6 +45,7 @@ type ( DstBucket string SrcObject string DstObject string + Header map[string]string } NeoFS interface { @@ -355,6 +357,11 @@ func (n *layer) CopyObject(ctx context.Context, p *CopyObjectParams) (*ObjectInf _ = pw.CloseWithError(err) }() + // set custom headers + for k, v := range p.Header { + info.Headers[k] = v + } + return n.PutObject(ctx, &PutObjectParams{ Bucket: p.DstBucket, Object: p.DstObject,