Merge 8c5e6b48d03b326c7f0b7d5cc544cd087db919f5 into 8763f33c65f7df8be5b9fe7504ab7fcf20abb41d

This commit is contained in:
JuHyeon Jeong 2025-03-23 09:37:08 +08:00 committed by GitHub
commit ef683da151
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -662,12 +662,12 @@ func (c *Context) FormFile(name string) (*multipart.FileHeader, error) {
return nil, err return nil, err
} }
} }
f, fh, err := c.Request.FormFile(name) if c.Request.MultipartForm != nil && c.Request.MultipartForm.File != nil {
if err != nil { if fhs := c.Request.MultipartForm.File[name]; len(fhs) > 0 {
return nil, err return fhs[0], nil
}
} }
f.Close() return nil, http.ErrMissingFile
return fh, err
} }
// MultipartForm is the parsed multipart form, including file uploads. // MultipartForm is the parsed multipart form, including file uploads.