Skip to content

Commit

Permalink
Solves psf#722
Browse files Browse the repository at this point in the history
  • Loading branch information
Kenneth Reitz committed Jul 27, 2012
1 parent d74d61e commit e0fed46
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion requests/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ def __call__(self, r):
r.url, r.headers, r.data = self.client.sign(
unicode(r.full_url), unicode(r.method), r.data, r.headers)

# Both flows add params to the URL by using r.full_url,
# so this prevents adding it again later
r.params = {}

# Having the authorization header, key or value, in unicode will
# result in UnicodeDecodeErrors when the request is concatenated
# by httplib. This can easily be seen when attaching files.
Expand Down Expand Up @@ -143,7 +147,7 @@ def handle_401(self, r):
"""Takes the given response and tries digest-auth, if needed."""

num_401_calls = r.request.hooks['response'].count(self.handle_401)

s_auth = r.headers.get('www-authenticate', '')

if 'digest' in s_auth.lower() and num_401_calls < 2:
Expand Down

0 comments on commit e0fed46

Please sign in to comment.