[#438] metabase: Fix saving of object payload in Put

Metabase should not store payloads of objects. Make Put operation to cut
object payload before saving binary object in metabase.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2021-03-22 19:46:46 +03:00 committed by Alex Vanin
parent e3f8470d7a
commit 8d5c17facd

View file

@ -196,7 +196,7 @@ func uniqueIndexes(obj *object.Object, si *objectSDK.SplitInfo, id *blobovnicza.
return nil, ErrUnknownObjectType
}
rawObject, err := obj.Marshal()
rawObject, err := object.NewRawFromObject(obj).CutPayload().Marshal()
if err != nil {
return nil, fmt.Errorf("can't marshal object header: %w", err)
}