diff --git a/pkg/services/container/morph/executor.go b/pkg/services/container/morph/executor.go index 24b523173..47ea3092e 100644 --- a/pkg/services/container/morph/executor.go +++ b/pkg/services/container/morph/executor.go @@ -8,9 +8,11 @@ import ( "github.com/nspcc-dev/neofs-api-go/pkg/owner" "github.com/nspcc-dev/neofs-api-go/v2/container" "github.com/nspcc-dev/neofs-api-go/v2/refs" + containerCore "github.com/nspcc-dev/neofs-node/pkg/core/container" containerMorph "github.com/nspcc-dev/neofs-node/pkg/morph/client/container" "github.com/nspcc-dev/neofs-node/pkg/morph/client/container/wrapper" containerSvc "github.com/nspcc-dev/neofs-node/pkg/services/container" + "github.com/pkg/errors" ) type morphExecutor struct { @@ -33,6 +35,10 @@ func (s *morphExecutor) Put(ctx context.Context, body *container.PutRequestBody) cnr := containerSDK.NewContainerFromV2(body.GetContainer()) sig := body.GetSignature() + if err := containerCore.CheckFormat(cnr); err != nil { + return nil, errors.Wrapf(err, "incorrect container format") + } + cid, err := s.wrapper.Put(cnr, sig.GetKey(), sig.GetSign()) if err != nil { return nil, err