]> git.ipfire.org Git - thirdparty/httpx.git/commitdiff
Case insensitive algorithm detection for digest authentication. (#2204)
authorTom Christie <tom@tomchristie.com>
Mon, 9 May 2022 09:42:57 +0000 (10:42 +0100)
committerGitHub <noreply@github.com>
Mon, 9 May 2022 09:42:57 +0000 (10:42 +0100)
Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>
httpx/_auth.py

index 343f9cdd16a5f56c0867c9db9305ebae25af0213..2b00b49d17d459983c187a11a857121c12ad424d 100644 (file)
@@ -210,7 +210,7 @@ class DigestAuth(Auth):
     def _build_auth_header(
         self, request: Request, challenge: "_DigestAuthChallenge"
     ) -> str:
-        hash_func = self._ALGORITHM_TO_HASH_FUNCTION[challenge.algorithm]
+        hash_func = self._ALGORITHM_TO_HASH_FUNCTION[challenge.algorithm.upper()]
 
         def digest(data: bytes) -> bytes:
             return hash_func(data).hexdigest().encode()