diff --git a/common/common.go b/common/common.go index 17c2585f..107ee4f1 100644 --- a/common/common.go +++ b/common/common.go @@ -787,8 +787,10 @@ func (conns *ActiveConnections) checkIdles() { toClose := true for _, conn := range conns.connections { if strings.Contains(conn.GetID(), idToMatch) { - toClose = false - break + if time.Since(conn.GetLastActivity()) <= Config.idleTimeoutAsDuration { + toClose = false + break + } } } if toClose { diff --git a/httpd/webadmin.go b/httpd/webadmin.go index c7d47fab..474a5b22 100644 --- a/httpd/webadmin.go +++ b/httpd/webadmin.go @@ -1509,7 +1509,7 @@ func handleWebAddAdminPost(w http.ResponseWriter, r *http.Request) { renderForbiddenPage(w, r, err.Error()) return } - err = dataprovider.AddAdmin(&admin, claims.Username, util.GetIPFromRemoteAddress(r.Method)) + err = dataprovider.AddAdmin(&admin, claims.Username, util.GetIPFromRemoteAddress(r.RemoteAddr)) if err != nil { renderAddUpdateAdminPage(w, r, &admin, err.Error(), true) return