mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-23 18:22:23 +08:00
attempt to fix bug for post-form map when go version is 1.6
This commit is contained in:
parent
9e1cbfca1b
commit
51386de165
11
context.go
11
context.go
@ -461,6 +461,17 @@ func (c *Context) GetPostFormMap(key string) (map[string]string, bool) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if !exist && req.MultipartForm != nil && req.MultipartForm.File != nil {
|
||||||
|
for k, v := range req.MultipartForm.Value {
|
||||||
|
if i := strings.IndexByte(k, '['); i >= 1 && k[0:i] == key {
|
||||||
|
if j := strings.IndexByte(k[i+1:], ']'); j >= 1 {
|
||||||
|
exist = true
|
||||||
|
dicts[k[i+1:][:j]] = v[0]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return dicts, exist
|
return dicts, exist
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user