Skip to content

Commit

Permalink
add NoReuse
Browse files Browse the repository at this point in the history
  • Loading branch information
icholy committed Nov 27, 2022
1 parent 71e3af5 commit d37de03
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ type Transport struct {
// set on the Request.
Jar http.CookieJar

// NoReuse prevents the transport from reusing challenges.
NoReuse bool

// cache of challenges indexed by host
cache map[string]*cchal
cacheMu sync.Mutex
Expand Down Expand Up @@ -103,6 +106,9 @@ func (t *Transport) challenge(req *http.Request) (*Challenge, int, bool) {
if !ok {
return nil, 0, false
}
if t.NoReuse {
delete(t.cache, host)
}
cc.n++
return cc.c, cc.n, true
}
Expand Down

0 comments on commit d37de03

Please sign in to comment.