dont fail empty payload

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2021-04-12 16:44:47 +03:00
parent 0d07e95704
commit 1307e2b50f

View File

@ -64,6 +64,8 @@ func (c *tomlCodec) ReadBody(conn io.Reader, b interface{}) error {
buf, err := ioutil.ReadAll(conn)
if err != nil {
return err
} else if buf == nil {
return nil
}
return toml.Unmarshal(buf, b)