Compare commits
1 commit
d14cb1f695
...
33dba5d68c
Author | SHA1 | Date | |
---|---|---|---|
33dba5d68c |
1 changed files with 9 additions and 2 deletions
|
@ -3,6 +3,7 @@ package handler
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
@ -76,8 +77,14 @@ func (h *Handler) getPayload(p getPayloadParams) (io.ReadCloser, uint64, error)
|
||||||
if !ok {
|
if !ok {
|
||||||
return p.obj.Payload, p.obj.Header.PayloadSize(), nil
|
return p.obj.Payload, p.obj.Header.PayloadSize(), nil
|
||||||
}
|
}
|
||||||
cid, _ := p.obj.Header.ContainerID()
|
cid, ok := p.obj.Header.ContainerID()
|
||||||
oid, _ := p.obj.Header.ID()
|
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)
|
size, err := strconv.ParseUint(sizeValue, 10, 64)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, 0, err
|
return nil, 0, err
|
||||||
|
|
Loading…
Add table
Reference in a new issue