1
0
mirror of https://github.com/astaxie/beego.git synced 2024-12-22 18:20:50 +00:00

Fix concurrent form parsing and getting

This commit is contained in:
playHing 2020-07-11 02:06:09 +08:00
parent b50fb44950
commit 55e6298f29

View File

@ -333,7 +333,11 @@ func (input *BeegoInput) Query(key string) string {
return val
}
if input.Context.Request.Form == nil {
input.Context.Request.ParseForm()
input.dataLock.Lock()
defer input.dataLock.Unlock()
if input.Context.Request.Form == nil {
input.Context.Request.ParseForm()
}
}
return input.Context.Request.Form.Get(key)
}