dont fail empty payload

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2021-04-12 16:40:45 +03:00
parent bec998a6f0
commit 76508814e7

View File

@ -72,6 +72,8 @@ func (c *jsonpbCodec) ReadBody(conn io.Reader, b interface{}) error {
buf, err := ioutil.ReadAll(conn)
if err != nil {
return err
} else if buf == nil {
return nil
}
return JsonpbUnmarshaler.Unmarshal(buf, m)
}