Skip to content

Commit

Permalink
fix(core): provider do_request to maintain verify in all request
Browse files Browse the repository at this point in the history
Signed-off-by: tarilabs <[email protected]>
  • Loading branch information
tarilabs committed Jun 24, 2024
1 parent fd8a83c commit fea039c
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions oras/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -950,18 +950,22 @@ def do_request(
json=json,
headers=headers,
stream=stream,
verify=self._tls_verify,
)

# One retry if 403 denied (need new token?)
if response.status_code == 403:
headers, changed = self.auth.authenticate_request(
response, headers, refresh=True
)
return self.session.request(
method,
url,
data=data,
json=json,
headers=headers,
stream=stream,
)
response = self.session.request(
method,
url,
data=data,
json=json,
headers=headers,
stream=stream,
verify=self._tls_verify,
)

return response

0 comments on commit fea039c

Please sign in to comment.