mirror of https://github.com/gin-gonic/gin.git
fix GetPostFormMap (#2051)
This commit is contained in:
parent
f38c30a0d2
commit
b8b2fada5c
|
@ -491,13 +491,8 @@ func (c *Context) PostFormMap(key string) map[string]string {
|
||||||
// GetPostFormMap returns a map for a given form key, plus a boolean value
|
// GetPostFormMap returns a map for a given form key, plus a boolean value
|
||||||
// whether at least one value exists for the given key.
|
// whether at least one value exists for the given key.
|
||||||
func (c *Context) GetPostFormMap(key string) (map[string]string, bool) {
|
func (c *Context) GetPostFormMap(key string) (map[string]string, bool) {
|
||||||
req := c.Request
|
c.getFormCache()
|
||||||
if err := req.ParseMultipartForm(c.engine.MaxMultipartMemory); err != nil {
|
return c.get(c.formCache, key)
|
||||||
if err != http.ErrNotMultipart {
|
|
||||||
debugPrint("error on parse multipart form map: %v", err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return c.get(req.PostForm, key)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// get is an internal method and returns a map which satisfy conditions.
|
// get is an internal method and returns a map which satisfy conditions.
|
||||||
|
|
Loading…
Reference in New Issue