19597: Parse multipart/form-data request body.
[arvados.git] / lib / controller / router / request.go
index 31f2e1d7baf5098a377ffe9d1acd7b737958231d..c0a2f23cc12c0ed2ddaf2566cb5bc6eff494fbf1 100644 (file)
@@ -62,6 +62,12 @@ func guessAndParse(k, v string) (interface{}, error) {
 // "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
+               }
+       }
        if err != nil {
                if err.Error() == "http: request body too large" {
                        return nil, httpError(http.StatusRequestEntityTooLarge, err)