Skip to content

Commit 30daaf9

Browse files
committed
Don't read the 401 response until we know we're going to make another request.
1 parent 841cd45 commit 30daaf9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

couchdb/http.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,10 +210,10 @@ def _retry():
210210

211211
# Handle authentication challenge
212212
if status == 401:
213-
resp.read()
214213
auth_header = resp.getheader('www-authenticate', '')
215214
if auth_header:
216215
if self._authenticate(auth_header, headers, credentials):
216+
resp.read() # read the 401 response
217217
resp = _try_request()
218218
status = resp.status
219219

0 commit comments

Comments
 (0)