Compare commits

..

1 commit

Author SHA1 Message Date
33dba5d68c [#142] Fix multipart-objects download
All checks were successful
/ DCO (pull_request) Successful in 43s
/ Vulncheck (pull_request) Successful in 1m24s
/ Builds (pull_request) Successful in 1m45s
/ Lint (pull_request) Successful in 2m53s
/ Tests (pull_request) Successful in 1m37s
Signed-off-by: Nikita Zinkevich <n.zinkevich@yadro.com>
2024-09-19 13:56:39 +03:00

View file

@ -3,6 +3,7 @@ package handler
import (
"context"
"encoding/json"
"errors"
"fmt"
"io"
"strconv"
@ -76,8 +77,14 @@ func (h *Handler) getPayload(p getPayloadParams) (io.ReadCloser, uint64, error)
if !ok {
return p.obj.Payload, p.obj.Header.PayloadSize(), nil
}
cid, _ := p.obj.Header.ContainerID()
oid, _ := p.obj.Header.ID()
cid, ok := p.obj.Header.ContainerID()
if !ok {
return nil, 0, errors.New("no container id set")
}
oid, ok := p.obj.Header.ID()
if !ok {
return nil, 0, errors.New("no object id set")
}
size, err := strconv.ParseUint(sizeValue, 10, 64)
if err != nil {
return nil, 0, err