update:getFormCache function

This commit is contained in:
0x2d3c 2020-04-21 19:34:45 +08:00
parent be4ba7d9df
commit dff9142611

View File

@ -482,14 +482,12 @@ func (c *Context) PostFormArray(key string) []string {
func (c *Context) getFormCache() { func (c *Context) getFormCache() {
if c.formCache == nil { if c.formCache == nil {
c.formCache = make(url.Values) if err := c.Request.ParseMultipartForm(c.engine.MaxMultipartMemory); err != nil {
req := c.Request
if err := req.ParseMultipartForm(c.engine.MaxMultipartMemory); err != nil {
if err != http.ErrNotMultipart { if err != http.ErrNotMultipart {
debugPrint("error on parse multipart form array: %v", err) debugPrint("error on parse multipart form array: %v", err)
} }
} }
c.formCache = req.PostForm c.formCache = c.Request.PostForm
} }
} }