Skip to content

Commit

Permalink
Improved diagnostic for HTTP response with no JSON
Browse files Browse the repository at this point in the history
  • Loading branch information
sdgathman authored Nov 10, 2021
1 parent c29c0f3 commit 0d11dd5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion acme_tiny.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def _do_request(url, data=None, err_msg="Error", depth=0):
try:
resp_data = json.loads(resp_data) # try to parse json results
except ValueError:
pass # ignore json parsing errors
resp_data = {'type':None, 'raw': resp_data}
if depth < 100 and code == 400 and resp_data['type'] == "urn:ietf:params:acme:error:badNonce":
raise IndexError(resp_data) # allow 100 retrys for bad nonces
if code not in [200, 201, 204]:
Expand Down

0 comments on commit 0d11dd5

Please sign in to comment.