Skip to content

Commit

Permalink
Case insensitive algorithm detection for digest authentication. (#2204)
Browse files Browse the repository at this point in the history
Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>
  • Loading branch information
tomchristie and Kludex committed May 9, 2022
1 parent e58b491 commit 850b480
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion httpx/_auth.py
Expand Up @@ -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()
Expand Down

0 comments on commit 850b480

Please sign in to comment.