Skip to content
Myr

compiled regex expression in digest auth, this also works in python 2.6.x

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Ovidiu Negrut · committed by Ovidiu Negrut · parent 186a589 · Browse files · 1 file+2 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+2 added−1 removed

  • other:+2 added−1 removed

1 file+2 added−1 removed

modified:requests/auth.py+2 added-1 removed
150 unmodified lines
151152 if 'digest' in s_auth.lower() and num_401_calls < 2:153154 setattr(self, 'num_401_calls', num_401_calls + 1)155 self.chal = parse_dict_header(re.sub(r'digest ', '', s_auth, flags=re.IGNORECASE))155 pat = re.compile(r'digest ', flags=re.IGNORECASE)156 self.chal = parse_dict_header(pat.sub('', s_auth))157158 # Consume content and release the original connection159 # to allow our new request to reuse the same one.160 r.content
17 unmodified lines