Skip to content

Commit

Permalink
Merge pull request #98 from dule1322/hotfix-refresh-token
Browse files Browse the repository at this point in the history
Hotfix: Properly update refresh token on request retry
  • Loading branch information
igorperic17 authored Nov 28, 2023
2 parents cb8eb4f + dbb24df commit 058dd85
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions coretex/networking/network_manager_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,11 +200,17 @@ def request(
logRequestFailure(endpoint, response)

if self.shouldRetry(retryCount, response):
if self._apiToken is not None:
headers[API_TOKEN_HEADER] = self._apiToken

return self.request(endpoint, requestType, headers, query, body, files, auth, stream, retryCount + 1)

return response
except:
if self.shouldRetry(retryCount, None):
if self._apiToken is not None:
headers[API_TOKEN_HEADER] = self._apiToken

return self.request(endpoint, requestType, headers, query, body, files, auth, stream, retryCount + 1)

raise RequestFailedError(endpoint, requestType)
Expand Down

0 comments on commit 058dd85

Please sign in to comment.