api/handler/rpc: fix corner cases

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2020-11-10 11:00:06 +03:00
parent fa9ef1c816
commit e3f235acc1
3 changed files with 8 additions and 4 deletions

View File

@@ -250,7 +250,9 @@ func requestPayload(r *http.Request) ([]byte, error) {
}
return raw.Marshal()
case strings.Contains(ct, "application/www-x-form-urlencoded"):
r.ParseForm()
if err = r.ParseForm(); err != nil {
return nil, err
}
// generate a new set of values from the form
vals := make(map[string]string, len(r.Form))