fix: locking the session object when it's read by the api module (fixes #349)

This commit is contained in:
evilsocket 2018-09-27 15:25:35 +02:00
parent 7951981815
commit 7b7739358d
2 changed files with 15 additions and 0 deletions

View file

@ -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":