mirror of
https://github.com/ipfs/kubo.git
synced 2025-07-01 19:24:14 +08:00
commands/http: client: Fixed decoding values in channel output
This commit is contained in:
@ -7,6 +7,7 @@ import (
|
||||
"io"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"reflect"
|
||||
"strings"
|
||||
|
||||
cmds "github.com/jbenet/go-ipfs/commands"
|
||||
@ -149,7 +150,8 @@ func getResponse(httpRes *http.Response, req cmds.Request) (cmds.Response, error
|
||||
outChan := make(chan interface{})
|
||||
go func() {
|
||||
dec := json.NewDecoder(httpRes.Body)
|
||||
v := req.Command().Type
|
||||
outputType := reflect.ValueOf(req.Command().Type).Type()
|
||||
v := reflect.New(outputType).Interface()
|
||||
|
||||
for {
|
||||
err := dec.Decode(&v)
|
||||
|
Reference in New Issue
Block a user