dont fail empty payload

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2021-04-12 16:43:49 +03:00
parent 55d2e88eca
commit e94afcc70a
2 changed files with 7 additions and 1 deletions

View File

@@ -61,6 +61,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)
}