Merge d27b492ba4e93809ce0e8fbf3316b58899edc45c into 8763f33c65f7df8be5b9fe7504ab7fcf20abb41d

This commit is contained in:
Erik Westra 2025-03-21 12:45:12 +01:00 committed by GitHub
commit d14ab249f0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 3 deletions

View File

@ -377,6 +377,7 @@ People and companies, who have contributed, in alphabetical order.
- vinhha96 <anhvinha1@gmail.com>
- voidman <retmain@foxmail.com>
- vz <vzvway@gmail.com>
- webstradev <erik@webstra.dev>
- wei <wei840222@gmail.com>
- weibaohui <weibaohui@yeah.net>
- whirosan <whirosan@users.noreply.github.com>

View File

@ -606,7 +606,7 @@ func (c *Context) PostFormArray(key string) (values []string) {
return
}
func (c *Context) initFormCache() {
func (c *Context) InitFormCache() {
if c.formCache == nil {
c.formCache = make(url.Values)
req := c.Request
@ -622,7 +622,7 @@ func (c *Context) initFormCache() {
// GetPostFormArray returns a slice of strings for a given form key, plus
// a boolean value whether at least one value exists for the given key.
func (c *Context) GetPostFormArray(key string) (values []string, ok bool) {
c.initFormCache()
c.InitFormCache()
values, ok = c.formCache[key]
return
}
@ -636,7 +636,7 @@ func (c *Context) PostFormMap(key string) (dicts map[string]string) {
// GetPostFormMap returns a map for a given form key, plus a boolean value
// whether at least one value exists for the given key.
func (c *Context) GetPostFormMap(key string) (map[string]string, bool) {
c.initFormCache()
c.InitFormCache()
return c.get(c.formCache, key)
}