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) buf, err := ioutil.ReadAll(conn)
if err != nil { if err != nil {
return err return err
} else if buf == nil {
return nil
} }
return JsonpbUnmarshaler.Unmarshal(buf, m) return JsonpbUnmarshaler.Unmarshal(buf, m)
} }