From 7db38c7eae0654824767bdb4ba3ae775996abaa4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Tue, 29 Nov 2022 21:53:16 +0800 Subject: [PATCH] Revised the code in the make_authorization method of the test client. --- src/flask_digest_auth/test.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/flask_digest_auth/test.py b/src/flask_digest_auth/test.py index 08a2ec7..6c4ade0 100644 --- a/src/flask_digest_auth/test.py +++ b/src/flask_digest_auth/test.py @@ -66,9 +66,8 @@ class Client(WerkzeugClient): :return: The request authorization. """ qop: t.Optional[t.Literal["auth", "auth-int"]] = None - if www_authenticate.qop is not None: - if "auth" in www_authenticate.qop: - qop = "auth" + if www_authenticate.qop is not None and "auth" in www_authenticate.qop: + qop = "auth" cnonce: t.Optional[str] = None if qop is not None or www_authenticate.algorithm == "MD5-sess":