projects
/
services
/
python-requests.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cb0fdd8
)
Release connection in digest auth 401 handler to allow the connection to be reused.
author
Peter Montagner
<zigmonty@gmail.com>
Sat, 18 Aug 2012 02:53:57 +0000
(12:53 +1000)
committer
Peter Montagner
<zigmonty@gmail.com>
Sat, 18 Aug 2012 02:53:57 +0000
(12:53 +1000)
requests/auth.py
patch
|
blob
|
history
diff --git
a/requests/auth.py
b/requests/auth.py
index
38dd874
..
e5176bf
100644
(file)
--- a/
requests/auth.py
+++ b/
requests/auth.py
@@
-227,6
+227,11
@@
class HTTPDigestAuth(AuthBase):
if qop:
base += ', qop=auth, nc=%s, cnonce="%s"' % (ncvalue, cnonce)
+ # Consume content and release the original connection
+ # to allow our new request to reuse the same one.
+ r.content
+ r.raw.release_conn()
+
r.request.headers['Authorization'] = 'Digest %s' % (base)
r.request.send(anyway=True)
_r = r.request.response