From 8e8cc8c7ce7dc7e85771bdc910ab9222f3b8314e Mon Sep 17 00:00:00 2001 From: borjha19 Date: Tue, 22 Apr 2025 09:37:46 -0700 Subject: [PATCH] percent decoding --- httpie/cli/argparser.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/httpie/cli/argparser.py b/httpie/cli/argparser.py index 9bf09b3b73..1a6c226865 100644 --- a/httpie/cli/argparser.py +++ b/httpie/cli/argparser.py @@ -5,7 +5,7 @@ import sys from argparse import RawDescriptionHelpFormatter from textwrap import dedent -from urllib.parse import urlsplit +from urllib.parse import urlsplit, unquote from requests.utils import get_netrc_auth @@ -289,8 +289,9 @@ def _process_auth(self): if self.args.auth is None and not auth_type_set: if url.username is not None: # Handle http://username:password@hostname/ - username = url.username - password = url.password or '' + username = unquote(url.username) if url.username and url.username != unquote(url.username) else url.username + password = unquote(url.password) if url.password and url.password != unquote(url.password) else (url.password or '') + self.args.auth = AuthCredentials( key=username, value=password,