mirror of
https://github.com/bettercap/bettercap
synced 2025-07-07 13:32:07 -07:00
fix: locking the session object when it's read by the api module (fixes #349)
This commit is contained in:
parent
7951981815
commit
7b7739358d
2 changed files with 15 additions and 0 deletions
|
@ -186,6 +186,9 @@ func (api *RestAPI) sessionRoute(w http.ResponseWriter, r *http.Request) {
|
|||
return
|
||||
}
|
||||
|
||||
session.I.Lock()
|
||||
defer session.I.Unlock()
|
||||
|
||||
path := r.URL.String()
|
||||
switch {
|
||||
case path == "/api/session":
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue