From c9fc8896562cc154eae41a51941bea6d701ed363 Mon Sep 17 00:00:00 2001 From: Lumir Balhar Date: Fri, 25 Jul 2025 12:17:00 +0200 Subject: [PATCH] CVE-2024-47081 --- requests/utils.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/requests/utils.py b/requests/utils.py index 04145c8..4a1b829 100644 --- a/requests/utils.py +++ b/requests/utils.py @@ -191,13 +191,7 @@ def get_netrc_auth(url, raise_errors=False): return ri = urlparse(url) - - # Strip port numbers from netloc. This weird `if...encode`` dance is - # used for Python 3.2, which doesn't support unicode literals. - splitstr = b':' - if isinstance(url, str): - splitstr = splitstr.decode('ascii') - host = ri.netloc.split(splitstr)[0] + host = ri.hostname try: _netrc = netrc(netrc_path).authenticators(host) -- 2.50.1