Merge 0e1e6d6ee893b44558cd153d292362ba178785d6 into dcaa4296d111981ffb31ac3eba90bb63e1eb5ab9

This commit is contained in:
water 2026-08-19 08:56:25 -07:00 committed by GitHub
commit ea84c574c2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

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