Skip to content

Commit

Permalink
Write object payload if exists (#822)
Browse files Browse the repository at this point in the history
closes #821
  • Loading branch information
roman-khimov committed Sep 12, 2023
2 parents f9c431c + b97b9bf commit 4bad84c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions internal/neofs/neofs.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,13 @@ func (x *NeoFS) CreateObject(ctx context.Context, prm layer.PrmObjectCreate) (oi
var lock object.Lock
lock.WriteMembers(prm.Locks)
obj.WriteLock(lock)

// we can't have locks and payload at the same time.
if len(obj.Payload()) > 0 && prm.Payload != nil {
return oid.ID{}, errors.New("lock object with payload")
}

prm.Payload = bytes.NewReader(obj.Payload())
}

var prmObjPutInit client.PrmObjectPutInit
Expand Down

0 comments on commit 4bad84c

Please sign in to comment.