Fix bug in HTTP-digest auth w/ URI having query string
authorTom Moertel <tom@smashcode.com>
Tue, 10 Jan 2012 23:09:49 +0000 (18:09 -0500)
committerTom Moertel <tom@smashcode.com>
Tue, 10 Jan 2012 23:18:54 +0000 (18:18 -0500)
requests/auth.py

index 4af3d6d3109fd43a8544ad011e49330731ff46ef..8ae2ec699348fde315dfe876b4539b7e3f2d2743 100644 (file)
@@ -86,7 +86,9 @@ class HTTPDigestAuth(AuthBase):
             # XXX not implemented yet
             entdig = None
             p_parsed = urlparse(r.request.url)
-            path = p_parsed.path + p_parsed.query
+            path = p_parsed.path
+            if p_parsed.query:
+                path += '?' + p_parsed.query
 
             A1 = '%s:%s:%s' % (self.username, realm, self.password)
             A2 = '%s:%s' % (r.request.method, path)