From 6682de4768d427b1d7c342d2d3cfb37d9741327e Mon Sep 17 00:00:00 2001 From: Denis Makogon Date: Sat, 7 Oct 2017 02:28:56 +0300 Subject: [PATCH] Addressing comments --- api/agent/protocol/json.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/api/agent/protocol/json.go b/api/agent/protocol/json.go index 77f065c27..e249d6c6c 100644 --- a/api/agent/protocol/json.go +++ b/api/agent/protocol/json.go @@ -40,10 +40,16 @@ func (h *JSONProtocol) DumpJSON(req *http.Request) error { err = writeString(err, h.in, "{") err = writeString(err, h.in, `"body":`) err = stdin.Encode(bb.String()) + if err != nil { + return err + } err = writeString(err, h.in, ",") defer bb.Reset() err = writeString(err, h.in, `"headers":`) err = stdin.Encode(req.Header) + if err != nil { + return err + } err = writeString(err, h.in, "}") return err }