projects
/
platform
/
upstream
/
python-requests.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3e72f23
)
Digest auth: case insensitive replacement of 'digest ' string with '' from WWW-Authen...
author
Ovidiu Negrut
<ovidiu@rohost.com>
Mon, 11 Mar 2013 08:28:37 +0000
(10:28 +0200)
committer
Ovidiu Negrut
<ovidiu@rohost.com>
Mon, 11 Mar 2013 08:28:37 +0000
(10:28 +0200)
requests/auth.py
patch
|
blob
|
history
diff --git
a/requests/auth.py
b/requests/auth.py
index 805f2400da2443fd0ed037de09617a3dd7440f0e..16546f291cc328d6d59174805d22b34abf7ceab0 100644
(file)
--- a/
requests/auth.py
+++ b/
requests/auth.py
@@
-8,6
+8,7
@@
This module contains the authentication handlers for Requests.
"""
import os
+import re
import time
import hashlib
import logging
@@
-151,7
+152,7
@@
class HTTPDigestAuth(AuthBase):
if 'digest' in s_auth.lower() and num_401_calls < 2:
setattr(self, 'num_401_calls', num_401_calls + 1)
- self.chal = parse_dict_header(
s_auth.replace('Digest ', ''
))
+ self.chal = parse_dict_header(
re.sub(r'digest ', '', s_auth, flags=re.IGNORECASE
))
# Consume content and release the original connection
# to allow our new request to reuse the same one.