Solves #722
authorKenneth Reitz <me@kennethreitz.com>
Fri, 27 Jul 2012 05:48:25 +0000 (01:48 -0400)
committerKenneth Reitz <me@kennethreitz.com>
Fri, 27 Jul 2012 05:48:25 +0000 (01:48 -0400)
requests/auth.py

index 8883df12c3632f638f22460a22da7afa49a081cf..6aee69b2df8eb68733f9e7ca1ef849a48c9040a4 100644 (file)
@@ -97,6 +97,10 @@ class OAuth1(AuthBase):
                 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.
@@ -143,7 +147,7 @@ class HTTPDigestAuth(AuthBase):
         """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: