diff options
author | SVN-Git Migration <python-modules-team@lists.alioth.debian.org> | 2015-10-08 13:41:28 -0700 |
---|---|---|
committer | SVN-Git Migration <python-modules-team@lists.alioth.debian.org> | 2015-10-08 13:41:28 -0700 |
commit | 653256249d44c67a0852d57a166948a9dc712ef4 (patch) | |
tree | 91efed3ad3640d3949be638ad4c4e45a63fd3864 /requests/auth.py | |
parent | c6ee35e00c5709435b3a6b664c44fceb70a918c6 (diff) | |
download | python-requests-653256249d44c67a0852d57a166948a9dc712ef4.tar python-requests-653256249d44c67a0852d57a166948a9dc712ef4.tar.gz |
Imported Upstream version 1.2.3
Diffstat (limited to 'requests/auth.py')
-rw-r--r-- | requests/auth.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/requests/auth.py b/requests/auth.py index 805f240..fab05cf 100644 --- 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 @@ -49,7 +50,7 @@ class HTTPBasicAuth(AuthBase): class HTTPProxyAuth(HTTPBasicAuth): - """Attaches HTTP Proxy Authenetication to a given Request object.""" + """Attaches HTTP Proxy Authentication to a given Request object.""" def __call__(self, r): r.headers['Proxy-Authorization'] = _basic_auth_str(self.username, self.password) return r @@ -151,7 +152,8 @@ 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 ', '')) + pat = re.compile(r'digest ', flags=re.IGNORECASE) + self.chal = parse_dict_header(pat.sub('', s_auth, count=1)) # Consume content and release the original connection # to allow our new request to reuse the same one. |