From f26385d59c326e112a0c62c947c4f17412d25d1e Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Thu, 5 May 2022 12:54:43 +0100 Subject: [PATCH] Case insensitive algorithm detection for digest authentication. --- 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()