CopyObject should contains custom headers

Signed-off-by: Evgeniy Kulikov <kim@nspcc.ru>
This commit is contained in:
Evgeniy Kulikov 2020-08-20 02:31:04 +03:00
parent fb00af23fb
commit 00a17d8316

View file

@ -10,6 +10,7 @@ import (
"github.com/nspcc-dev/neofs-api-go/object" "github.com/nspcc-dev/neofs-api-go/object"
"github.com/nspcc-dev/neofs-api-go/refs" "github.com/nspcc-dev/neofs-api-go/refs"
"github.com/nspcc-dev/neofs-api-go/service" "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/nspcc-dev/neofs-s3-gate/api/pool"
"github.com/pkg/errors" "github.com/pkg/errors"
"go.uber.org/zap" "go.uber.org/zap"
@ -44,6 +45,7 @@ type (
DstBucket string DstBucket string
SrcObject string SrcObject string
DstObject string DstObject string
Header map[string]string
} }
NeoFS interface { NeoFS interface {
@ -355,6 +357,11 @@ func (n *layer) CopyObject(ctx context.Context, p *CopyObjectParams) (*ObjectInf
_ = pw.CloseWithError(err) _ = pw.CloseWithError(err)
}() }()
// set custom headers
for k, v := range p.Header {
info.Headers[k] = v
}
return n.PutObject(ctx, &PutObjectParams{ return n.PutObject(ctx, &PutObjectParams{
Bucket: p.DstBucket, Bucket: p.DstBucket,
Object: p.DstObject, Object: p.DstObject,