[#431] object/range: Fix payload slice allocation in re-sign callback

Allocate capacity instead of length of the slice to write the object payload
range since each chunk is written through `append`.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2021-04-30 10:41:26 +03:00 committed by Leonard Lyubich
parent 36088949fc
commit 7366d62e41

View file

@ -204,7 +204,7 @@ func (s *Service) toRangePrm(req *objectV2.GetRangeRequest, stream objectSvc.Get
return nil, errors.Wrap(err, "could not create Get payload range stream")
}
payload := make([]byte, body.GetRange().GetLength())
payload := make([]byte, 0, body.GetRange().GetLength())
resp := new(objectV2.GetRangeResponse)