ipfsproxy: fix 'undefined cid' string appeareance in progress output
Fixes #1286. Some AddedOutput objects carry an undefined CID. This was getting stringified as 'b', making the proxy responses include this rather than skipping setting the field.
This commit is contained in:
parent
c78f7839a2
commit
a39ee13834
|
@ -563,9 +563,13 @@ func (proxy *Server) addHandler(w http.ResponseWriter, r *http.Request) {
|
|||
logger.Warnf("Proxy/add does not support all IPFS params. Current options: %+v", params)
|
||||
|
||||
outputTransform := func(in *api.AddedOutput) interface{} {
|
||||
cidStr := ""
|
||||
if in.Cid.Defined() {
|
||||
cidStr = in.Cid.String()
|
||||
}
|
||||
r := &ipfsAddResp{
|
||||
Name: in.Name,
|
||||
Hash: in.Cid.String(),
|
||||
Hash: cidStr,
|
||||
Bytes: int64(in.Bytes),
|
||||
}
|
||||
if in.Size != 0 {
|
||||
|
|
Loading…
Reference in New Issue
Block a user