From: Tom Christie Date: Mon, 9 May 2022 09:42:57 +0000 (+0100) Subject: Case insensitive algorithm detection for digest authentication. (#2204) X-Git-Tag: 0.23.0~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=850b4801d6911f3278ab1cefc26b21712faeefa0;p=thirdparty%2Fhttpx.git Case insensitive algorithm detection for digest authentication. (#2204) Co-authored-by: Marcelo Trylesinski --- diff --git a/httpx/_auth.py b/httpx/_auth.py index 343f9cdd..2b00b49d 100644 --- a/httpx/_auth.py +++ b/httpx/_auth.py @@ -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()