From 850b4801d6911f3278ab1cefc26b21712faeefa0 Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Mon, 9 May 2022 10:42:57 +0100 Subject: [PATCH] Case insensitive algorithm detection for digest authentication. (#2204) Co-authored-by: Marcelo Trylesinski --- httpx/_auth.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/httpx/_auth.py b/httpx/_auth.py index 343f9cdd16..2b00b49d17 100644 --- a/httpx/_auth.py +++ b/httpx/_auth.py @@ -210,7 +210,7 @@ def _parse_challenge( 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()