dont fail empty payload
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
parent
549ab44fa0
commit
bd5c06922d
2
proto.go
2
proto.go
@ -57,6 +57,8 @@ func (c *protoCodec) 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 proto.Unmarshal(buf, m)
|
return proto.Unmarshal(buf, m)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user