Project

General

Profile

Bug #19597 ยป 19597-ParseMultipartForm-only.patch

Brett Smith, 01/10/2023 11:41 PM

View differences:

lib/controller/router/request.go
// If the request has a parameter whose name is attrsKey (e.g.,
// "collection"), it is renamed to "attrs".
func (rtr *router) loadRequestParams(req *http.Request, attrsKey string) (map[string]interface{}, error) {
err := req.ParseForm()
if err == nil {
err = req.ParseMultipartForm(int64(rtr.config.MaxRequestSize))
if err == http.ErrNotMultipart {
err = nil
}
err := req.ParseMultipartForm(int64(rtr.config.MaxRequestSize))
if err == http.ErrNotMultipart {
err = nil
}
if err != nil {
if err.Error() == "http: request body too large" {
    (1-1/1)