Skip to content
Myr

Merge pull request #727 from vickimo/issue_547

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Fix infinite loop on wrong Digest Authentication (Issue #541 and #547)

authored by Kenneth Reitz · committed by Kenneth Reitz · parents a97a513, 5296b8b · Browse files · 1 file+3 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+3 added−3 removed

  • other:+3 added−3 removed

1 file+3 added−3 removed

modified:requests/auth.py+3 added-3 removed
131 unmodified lines
132133 def handle_401(self, r):134 """Takes the given response and tries digest-auth, if needed."""135136 r.request.deregister_hook('response', self.handle_401)137136 num_401_calls = r.request.hooks['response'].count(self.handle_401)137 138 s_auth = r.headers.get('www-authenticate', '')139140 if 'digest' in s_auth.lower():140 if 'digest' in s_auth.lower() and num_401_calls < 2:141142 last_nonce = ''143 nonce_count = 0144
83 unmodified lines