mirror of
https://github.com/bettercap/bettercap
synced 2025-07-11 07:37:00 -07:00
misc: small fix or general refactoring i did not bother commenting
This commit is contained in:
parent
7cf10ec0c7
commit
d7d85c588a
1 changed files with 4 additions and 5 deletions
|
@ -39,9 +39,6 @@ func (t *CookieTracker) keyOf(req *http.Request) string {
|
|||
}
|
||||
|
||||
func (t *CookieTracker) IsClean(req *http.Request) bool {
|
||||
// t.RLock()
|
||||
// defer t.RUnlock()
|
||||
|
||||
// we only clean GET requests
|
||||
if req.Method != "GET" {
|
||||
return true
|
||||
|
@ -53,6 +50,9 @@ func (t *CookieTracker) IsClean(req *http.Request) bool {
|
|||
return true
|
||||
}
|
||||
|
||||
t.RLock()
|
||||
defer t.RUnlock()
|
||||
|
||||
// was it already processed?
|
||||
if _, found := t.set[t.keyOf(req)]; found == true {
|
||||
return true
|
||||
|
@ -65,8 +65,7 @@ func (t *CookieTracker) IsClean(req *http.Request) bool {
|
|||
func (t *CookieTracker) Track(req *http.Request) {
|
||||
t.Lock()
|
||||
defer t.Unlock()
|
||||
reqKey := t.keyOf(req)
|
||||
t.set[reqKey] = true
|
||||
t.set[t.keyOf(req)] = true
|
||||
}
|
||||
|
||||
func (t *CookieTracker) Expire(req *http.Request) *http.Response {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue