1
0
mirror of https://github.com/rancher/norman.git synced 2025-09-01 07:08:59 +00:00

Use request.PostForm instead of request.Form when

PostForm will ignore URL query parameters and will only look at the
body. This is much more useful for actions, which have a query param
that is the action name, but the a json body.  WIthout this change,
the only "field" found when parsing an action body is the name of the
action.
This commit is contained in:
Craig Jellick
2018-03-14 18:57:57 -07:00
parent cd5dee7857
commit ba0bb125c9

View File

@@ -281,7 +281,7 @@ func Body(req *http.Request) (map[string]interface{}, error) {
return valuesToBody(req.MultipartForm.Value), nil
}
if req.Form != nil && len(req.Form) > 0 {
if req.PostForm != nil && len(req.PostForm) > 0 {
return valuesToBody(map[string][]string(req.Form)), nil
}