cookie is a struct, grab the value for index
This commit is contained in:
parent
a38c82fd21
commit
ec7ad148cf
7
main.go
7
main.go
|
@ -69,15 +69,16 @@ func filter(res http.ResponseWriter, req *http.Request, listenPort, proxyPort in
|
|||
}
|
||||
|
||||
//log.Debugf("%v: Request %v %v\n", ip, req.Host, req.URL)
|
||||
cookie, err := req.Cookie("i_like_gogits")
|
||||
log.Debugf("ip: %v cookie: %v\n", ip, cookie)
|
||||
cookieObj, err := req.Cookie("i_like_gogits")
|
||||
log.Debugf("ip: %v cookie: %v\n", ip, cookieObj)
|
||||
if err != nil {
|
||||
pass(res, req, listenPort, proxyPort)
|
||||
return
|
||||
}
|
||||
|
||||
ips, ok := cookiesToIps.Load(cookie)
|
||||
cookie := cookieObj.Value
|
||||
|
||||
ips, ok := cookiesToIps.Load(cookie)
|
||||
if !ok {
|
||||
ips := Ip2LastSeen{ip: time.Now()}
|
||||
cookiesToIps.Store(cookie, ips)
|
||||
|
|
Loading…
Reference in New Issue