From 51386de165ae50a61c06d80f06ec703810a2d62d Mon Sep 17 00:00:00 2001 From: thinkerou Date: Thu, 7 Jun 2018 08:29:04 +0800 Subject: [PATCH] attempt to fix bug for post-form map when go version is 1.6 --- context.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/context.go b/context.go index bc7f0d81..74c5ddd1 100755 --- a/context.go +++ b/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 }