From 2e7699bfd24d69cd5ea2603b1472a2e47a00c76d Mon Sep 17 00:00:00 2001 From: Varun Chawla Date: Sun, 8 Feb 2026 12:39:17 -0800 Subject: [PATCH] fix: use urlsplit instead of urlparse for digest auth URI urlparse treats semicolons as parameter separators, which strips everything after the first semicolon in the URL path from the digest auth `uri` field. urlsplit does not have this behavior and correctly preserves semicolons in the path. Fixes #6990 --- src/requests/auth.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/requests/auth.py b/src/requests/auth.py index c39b645189..db99e9392d 100644 --- a/src/requests/auth.py +++ b/src/requests/auth.py @@ -14,7 +14,7 @@ from base64 import b64encode from ._internal_utils import to_native_string -from .compat import basestring, str, urlparse +from .compat import basestring, str, urlsplit from .cookies import extract_cookies_to_jar from .utils import parse_dict_header @@ -180,7 +180,7 @@ def sha512_utf8(x): # XXX not implemented yet entdig = None - p_parsed = urlparse(url) + p_parsed = urlsplit(url) #: path is request-uri defined in RFC 2616 which should not be empty path = p_parsed.path or "/" if p_parsed.query: