Skip to content

Commit

Permalink
put the happy path first
Browse files Browse the repository at this point in the history
  • Loading branch information
icholy committed Nov 27, 2022
1 parent 70a91fd commit 28bb370
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,11 @@ func (t *Transport) save(res *http.Response) error {
// to match against outgoing requests. We're currently ignoring
// it and just matching the hostname.
host := res.Request.URL.Hostname()
if err != nil {
delete(t.cache, host)
} else {
if err == nil {
t.cache[host] = &cchal{c: chal}
} else {
// if save is being invoked, the existing cached challenge didn't work
delete(t.cache, host)
}
t.cacheMu.Unlock()
return err
Expand Down

0 comments on commit 28bb370

Please sign in to comment.