dont fail empty payload
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
parent
ac0ab02645
commit
3b0e9fcda2
7
json.go
7
json.go
@ -54,7 +54,12 @@ func (c *jsonCodec) ReadBody(conn io.Reader, b interface{}) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
return json.NewDecoder(conn).Decode(b)
|
||||
err := json.NewDecoder(conn).Decode(b)
|
||||
if err == io.EOF {
|
||||
return nil
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *jsonCodec) Write(conn io.Writer, m *codec.Message, b interface{}) error {
|
||||
|
Loading…
Reference in New Issue
Block a user