From bd5c06922d759b695b6e4f7c7146464d506876b1 Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Mon, 12 Apr 2021 16:42:06 +0300 Subject: [PATCH] dont fail empty payload Signed-off-by: Vasiliy Tolstov --- proto.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/proto.go b/proto.go index e649574..e3721e4 100644 --- a/proto.go +++ b/proto.go @@ -57,6 +57,8 @@ func (c *protoCodec) ReadBody(conn io.Reader, b interface{}) error { buf, err := ioutil.ReadAll(conn) if err != nil { return err + } else if buf == nil { + return nil } return proto.Unmarshal(buf, m) }