Skip to content

Commit e535fe8

Browse files
committed
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
1 parent 0e4ae38 commit e535fe8

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/requests/auth.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from base64 import b64encode
1515

1616
from ._internal_utils import to_native_string
17-
from .compat import basestring, str, urlparse
17+
from .compat import basestring, str, urlsplit
1818
from .cookies import extract_cookies_to_jar
1919
from .utils import parse_dict_header
2020

@@ -180,7 +180,7 @@ def sha512_utf8(x):
180180

181181
# XXX not implemented yet
182182
entdig = None
183-
p_parsed = urlparse(url)
183+
p_parsed = urlsplit(url)
184184
#: path is request-uri defined in RFC 2616 which should not be empty
185185
path = p_parsed.path or "/"
186186
if p_parsed.query:

0 commit comments

Comments
 (0)