Skip to content

Commit

Permalink
Add timeout to refresh token calls (#192)
Browse files Browse the repository at this point in the history
  • Loading branch information
rogebrd authored Apr 21, 2020
1 parent d53cc31 commit 13ec3ac
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion dropbox/dropbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,10 @@ def refresh_access_token(self, host=API_HOST, scope=None):
scope = " ".join(scope)
body['scope'] = scope

res = self._session.post(url, data=body)
timeout = self._DEFAULT_TIMEOUT
if self._timeout:
timeout = self._timeout
res = self._session.post(url, data=body, timeout=timeout)
if res.status_code == 400 and res.json()['error'] == 'invalid_grant':
request_id = res.headers.get('x-dropbox-request-id')
err = stone_serializers.json_compat_obj_decode(
Expand Down

0 comments on commit 13ec3ac

Please sign in to comment.