Skip to content

Commit

Permalink
Rlock for form query
Browse files Browse the repository at this point in the history
  • Loading branch information
playHing committed Jul 15, 2020
1 parent 55e6298 commit 3e2c795
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion context/input.go
Original file line number Diff line number Diff line change
Expand Up @@ -334,11 +334,13 @@ func (input *BeegoInput) Query(key string) string {
}
if input.Context.Request.Form == nil {
input.dataLock.Lock()
defer input.dataLock.Unlock()
if input.Context.Request.Form == nil {
input.Context.Request.ParseForm()
}
input.dataLock.Unlock()
}
input.dataLock.RLock()
defer input.dataLock.RUnlock()
return input.Context.Request.Form.Get(key)
}

Expand Down

0 comments on commit 3e2c795

Please sign in to comment.