mirror of
https://github.com/rancher/norman.git
synced 2025-09-06 17:50:25 +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:
@@ -281,7 +281,7 @@ func Body(req *http.Request) (map[string]interface{}, error) {
|
|||||||
return valuesToBody(req.MultipartForm.Value), nil
|
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
|
return valuesToBody(map[string][]string(req.Form)), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user