Skip to content

Commit

Permalink
changed IP whitelist time from 5 minutes to 5 seconds since it broke …
Browse files Browse the repository at this point in the history
…session creation for new visitors
  • Loading branch information
kgretzky committed Jan 6, 2019
1 parent 71dd650 commit 5a477f7
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions core/http_proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -856,7 +856,7 @@ func (p *HttpProxy) deleteRequestCookie(name string, req *http.Request) {

func (p *HttpProxy) whitelistIP(ip_addr string, sid string) {
log.Debug("whitelistIP: %s %s", ip_addr, sid)
p.ip_whitelist[ip_addr] = time.Now().Add(5 * time.Minute).Unix()
p.ip_whitelist[ip_addr] = time.Now().Add(5 * time.Second).Unix()
p.ip_sids[ip_addr] = sid
}

Expand All @@ -865,7 +865,6 @@ func (p *HttpProxy) isWhitelistedIP(ip_addr string) bool {
ct := time.Now()
if ip_t, ok := p.ip_whitelist[ip_addr]; ok {
et := time.Unix(ip_t, 0)
fmt.Println(ct.Unix(), et.Unix())
return ct.Before(et)
}
return false
Expand Down

0 comments on commit 5a477f7

Please sign in to comment.