dont fail empty payload
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
parent
0d07e95704
commit
1307e2b50f
2
toml.go
2
toml.go
@ -64,6 +64,8 @@ func (c *tomlCodec) 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 toml.Unmarshal(buf, b)
|
return toml.Unmarshal(buf, b)
|
||||||
|
Loading…
Reference in New Issue
Block a user