ignore EOF when parsing form as json

This commit is contained in:
Adrien Marquès 2020-03-20 22:18:34 +01:00
parent 0f62fc25a0
commit c7aa87c660
Signed by: xdrm-brackets
GPG Key ID: D75243CA236D825E
1 changed files with 3 additions and 0 deletions

View File

@ -141,6 +141,9 @@ func (i *Set) parseJSON(req *http.Request) error {
decoder := json.NewDecoder(req.Body)
if err := decoder.Decode(&parsed); err != nil {
if err == io.EOF {
return nil
}
return err
}