From 7b812c6648c153c828e207836ab54eaf2cac6e94 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Fri, 20 Mar 2020 22:35:53 +0100 Subject: [PATCH] get data from multipart components --- internal/reqdata/set.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/reqdata/set.go b/internal/reqdata/set.go index c09ab83..355a7a1 100644 --- a/internal/reqdata/set.go +++ b/internal/reqdata/set.go @@ -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) }