dont fail empty payload
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
parent
bec998a6f0
commit
76508814e7
@ -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)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user