Skip to content

Commit

Permalink
Debug HTTP headers.
Browse files Browse the repository at this point in the history
  • Loading branch information
arthepsy committed Jan 24, 2019
1 parent 281aa34 commit 2adb621
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion gp-okta.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,8 @@ def send_req(conf, s, name, url, data, **kwargs):
r = s.get(url, headers=headers)
else:
r = s.post(url, data=data, headers=headers)
rr = 'status code: {0}, text:\n{1}'.format(r.status_code, r.text)
hdump = '\n'.join([k + ': ' + v for k, v in sorted(r.headers.items())])
rr = 'status: {0}\n\n{1}\n\n{2}'.format(r.status_code, hdump, r.text)
if r.status_code != 200:
err('okta {0} request failed. {0}'.format(rr))
dbg(conf.get('debug'), '{0}.response'.format(name), rr)
Expand Down

0 comments on commit 2adb621

Please sign in to comment.