[#278] pkg/client: Fix payload slice allocation in Object Range method

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:52:45 +03:00 committed by Alex Vanin
parent bb217067f4
commit fcb2cce8a0

View file

@ -874,7 +874,7 @@ func (c *clientImpl) ObjectPayloadRangeData(ctx context.Context, p *RangeDataPar
var payload []byte
if p.w != nil {
payload = make([]byte, p.r.GetLength())
payload = make([]byte, 0, p.r.GetLength())
}
resp := new(v2object.GetRangeResponse)