get data from multipart components

This commit is contained in:
Adrien Marquès 2020-03-20 22:35:53 +01:00
parent dc34d9a81a
commit 7b812c6648
Signed by: xdrm-brackets
GPG Key ID: D75243CA236D825E
1 changed files with 2 additions and 2 deletions

View File

@ -232,7 +232,7 @@ func (i *Set) parseMultipart(req *http.Request) error {
}
for name, param := range i.service.Form {
value, exist := mpr.Data[name]
component, exist := mpr.Data[name]
// fail on missing required
if !exist && !param.Optional {
@ -245,7 +245,7 @@ func (i *Set) parseMultipart(req *http.Request) error {
}
// fail on invalid type
cast, valid := param.Validator(value)
cast, valid := param.Validator(string(component.Data))
if !valid {
return fmt.Errorf("%s: %w", name, ErrInvalidType)
}