1
0
mirror of https://github.com/labstack/echo.git synced 2025-11-25 22:32:23 +02:00

Merge pull request #418 from rlcomte/master

Improved error handling of multipart requests
This commit is contained in:
Vishal Rana
2016-03-18 08:22:49 -07:00
2 changed files with 4 additions and 4 deletions

View File

@@ -100,8 +100,8 @@ func (r *Request) FormFile(name string) (*multipart.FileHeader, error) {
// MultipartForm implements `engine.Request#MultipartForm` method.
func (r *Request) MultipartForm() (*multipart.Form, error) {
r.Request.ParseMultipartForm(32 << 20) // 32 MB
return r.Request.MultipartForm, nil
err := r.Request.ParseMultipartForm(32 << 20) // 32 MB
return r.Request.MultipartForm, err
}
func (r *Request) reset(req *http.Request, h engine.Header, u engine.URL) {

View File

@@ -94,8 +94,8 @@ func (r *Request) FormFile(name string) (*multipart.FileHeader, error) {
}
func (r *Request) MultipartForm() (*multipart.Form, error) {
m := r.request.MultipartForm
return m, nil
err := r.request.ParseMultipartForm(32 << 20) // 32 MB
return r.request.MultipartForm, err
}
func (r *Request) reset(req *http.Request, h engine.Header, u engine.URL) {