mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 09:20:55 +00:00
Fix concurrent form parsing and getting
This commit is contained in:
parent
b50fb44950
commit
55e6298f29
@ -332,9 +332,13 @@ func (input *BeegoInput) Query(key string) string {
|
|||||||
if val := input.Param(key); val != "" {
|
if val := input.Param(key); val != "" {
|
||||||
return val
|
return val
|
||||||
}
|
}
|
||||||
|
if input.Context.Request.Form == nil {
|
||||||
|
input.dataLock.Lock()
|
||||||
|
defer input.dataLock.Unlock()
|
||||||
if input.Context.Request.Form == nil {
|
if input.Context.Request.Form == nil {
|
||||||
input.Context.Request.ParseForm()
|
input.Context.Request.ParseForm()
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return input.Context.Request.Form.Get(key)
|
return input.Context.Request.Form.Get(key)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user