From: Georg Brandl Date: Sun, 4 May 2008 21:40:44 +0000 (+0000) Subject: #2695: Do case-insensitive check for algorithms. X-Git-Tag: v2.6a3~34 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8d66dcd0f44ab1d5786cfa102b6f2deed63f9d2c;p=thirdparty%2FPython%2Fcpython.git #2695: Do case-insensitive check for algorithms. --- diff --git a/Lib/urllib2.py b/Lib/urllib2.py index 817c5a7d8b86..546cea68357a 100644 --- a/Lib/urllib2.py +++ b/Lib/urllib2.py @@ -976,6 +976,8 @@ class AbstractDigestAuthHandler: return base def get_algorithm_impls(self, algorithm): + # algorithm should be case-insensitive according to RFC2617 + algorithm = algorithm.upper() # lambdas assume digest modules are imported at the top level if algorithm == 'MD5': H = lambda x: hashlib.md5(x).hexdigest()