Case insensitive algorithm detection for digest authentication. (#2204)

Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>
This commit is contained in:
Tom Christie 2022-05-09 10:42:57 +01:00 committed by GitHub
parent e58b491d11
commit 850b4801d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View 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()