]> granicus.if.org Git - python/commitdiff
#2695: Do case-insensitive check for algorithms.
authorGeorg Brandl <georg@python.org>
Sun, 4 May 2008 21:40:44 +0000 (21:40 +0000)
committerGeorg Brandl <georg@python.org>
Sun, 4 May 2008 21:40:44 +0000 (21:40 +0000)
Lib/urllib2.py

index 817c5a7d8b861bd823af07f1bfbc7b79677f3eea..546cea68357a97be605b462bc4f10f12635c6bb7 100644 (file)
@@ -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()