1
0
mirror of https://github.com/labstack/echo.git synced 2024-12-24 20:14:31 +02:00

Fix panic in FormFile if file not found (#1515)

This commit is contained in:
lukesolo 2020-02-29 17:46:25 +02:00 committed by GitHub
parent 91b853a6f2
commit 84b8aaf24f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -360,8 +360,11 @@ func (c *context) FormParams() (url.Values, error) {
func (c *context) FormFile(name string) (*multipart.FileHeader, error) {
f, fh, err := c.request.FormFile(name)
if err != nil {
return nil, err
}
defer f.Close()
return fh, err
return fh, nil
}
func (c *context) MultipartForm() (*multipart.Form, error) {