Skip to content

Commit 32beead

Browse files
author
jianqli
committed
fix token issue which results in endless loop on reauth
1 parent 6e5b7d6 commit 32beead

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

provider_client.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,6 @@ func (client *ProviderClient) Request(method, url string, options *RequestOpts)
145145
}
146146
req.Header.Set("Accept", applicationJSON)
147147

148-
for k, v := range client.AuthenticatedHeaders() {
149-
req.Header.Add(k, v)
150-
}
151-
152148
// Set the User-Agent header
153149
req.Header.Set("User-Agent", client.UserAgent.Join())
154150

@@ -162,6 +158,11 @@ func (client *ProviderClient) Request(method, url string, options *RequestOpts)
162158
}
163159
}
164160

161+
// get latest token from client
162+
for k, v := range client.AuthenticatedHeaders() {
163+
req.Header.Set(k, v)
164+
}
165+
165166
// Set connection parameter to close the connection immediately when we've got the response
166167
req.Close = true
167168

0 commit comments

Comments
 (0)