ignore io.EOF while parsing multipart

This commit is contained in:
Adrien Marquès 2020-03-20 22:27:01 +01:00
parent 03d5e87c37
commit cdbe4cceac
Signed by: xdrm-brackets
GPG Key ID: D75243CA236D825E
1 changed files with 4 additions and 0 deletions

View File

@ -3,6 +3,7 @@ package reqdata
import (
"encoding/json"
"fmt"
"io"
"git.xdrm.io/go/aicra/internal/config"
"git.xdrm.io/go/aicra/internal/multipart"
@ -219,6 +220,9 @@ func (i *Set) parseMultipart(req *http.Request) error {
boundary := req.Header.Get("Content-Type")[len("multipart/form-data; boundary="):]
mpr, err := multipart.NewReader(req.Body, boundary)
if err != nil {
if err == io.EOF {
return nil
}
return err
}