Skip to content

Commit

Permalink
Merge pull request #36 from mkomitee/master
Browse files Browse the repository at this point in the history
Handle mutual authentication
  • Loading branch information
sigmavirus24 committed Nov 4, 2014
2 parents c5553e4 + 9c1e08c commit 208bebb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion requests_kerberos/kerberos_.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ def handle_response(self, response, **kwargs):
if response.status_code == 401:
_r = self.handle_401(response, **kwargs)
log.debug("handle_response(): returning {0}".format(_r))
return _r
return self.handle_response(_r, **kwargs)
else:
_r = self.handle_other(response)
log.debug("handle_response(): returning {0}".format(_r))
Expand Down
4 changes: 4 additions & 0 deletions test_requests_kerberos.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,10 +402,14 @@ def test_handle_response_401(self):
response.connection = connection
response._content = ""
response.raw = raw

auth = requests_kerberos.HTTPKerberosAuth()
auth.handle_other = Mock(return_value=response_ok)

r = auth.handle_response(response)

self.assertTrue(response in r.history)
auth.handle_other.assert_called_with(response_ok)
self.assertEqual(r, response_ok)
self.assertEqual(request.headers['Authorization'], 'Negotiate GSSRESPONSE')
connection.send.assert_called_with(request)
Expand Down

0 comments on commit 208bebb

Please sign in to comment.