From f98e202e2c3458e2d7a9405f90f589c68c4d8862 Mon Sep 17 00:00:00 2001 From: Scott P Date: Wed, 22 Feb 2023 15:01:54 -0800 Subject: [PATCH] fix DigestAuth default value for qop field Make the default qop value the same as Chrome, curl and others. Without this some servers will obviously give status 401. --- httpx/_auth.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/httpx/_auth.py b/httpx/_auth.py index e67e0c15c4..d1b25b6260 100644 --- a/httpx/_auth.py +++ b/httpx/_auth.py @@ -242,7 +242,7 @@ def _parse_challenge( nonce = header_dict["nonce"].encode() algorithm = header_dict.get("algorithm", "MD5") opaque = header_dict["opaque"].encode() if "opaque" in header_dict else None - qop = header_dict["qop"].encode() if "qop" in header_dict else None + qop = header_dict["qop"].encode() if "qop" in header_dict else b"auth" return _DigestAuthChallenge( realm=realm, nonce=nonce, algorithm=algorithm, opaque=opaque, qop=qop )