mirror of
https://github.com/curl/curl.git
synced 2026-08-25 14:43:33 +03:00
proxy-auth: additional tests
Also eliminate the special handling for socks proxy match. Closes #20837
This commit is contained in:
parent
e47b6e657a
commit
5f13a7645e
3 changed files with 42 additions and 24 deletions
|
|
@ -724,7 +724,8 @@ class CurlClient:
|
|||
with_tcpdump: bool = False,
|
||||
no_save: bool = False,
|
||||
limit_rate: Optional[str] = None,
|
||||
extra_args: Optional[List[str]] = None):
|
||||
extra_args: Optional[List[str]] = None,
|
||||
url_options: Optional[Dict[str,List[str]]] = None):
|
||||
if extra_args is None:
|
||||
extra_args = []
|
||||
if no_save:
|
||||
|
|
@ -742,6 +743,7 @@ class CurlClient:
|
|||
])
|
||||
return self._raw(urls, alpn_proto=alpn_proto, options=extra_args,
|
||||
with_stats=with_stats,
|
||||
url_options=url_options,
|
||||
with_headers=with_headers,
|
||||
with_profile=with_profile,
|
||||
with_tcpdump=with_tcpdump)
|
||||
|
|
@ -1083,6 +1085,7 @@ class CurlClient:
|
|||
|
||||
def _raw(self, urls, intext='', timeout=None, options=None, insecure=False,
|
||||
alpn_proto: Optional[str] = None,
|
||||
url_options=None,
|
||||
force_resolve=True,
|
||||
with_stats=False,
|
||||
with_headers=True,
|
||||
|
|
@ -1092,7 +1095,8 @@ class CurlClient:
|
|||
args = self._complete_args(
|
||||
urls=urls, timeout=timeout, options=options, insecure=insecure,
|
||||
alpn_proto=alpn_proto, force_resolve=force_resolve,
|
||||
with_headers=with_headers, def_tracing=def_tracing)
|
||||
with_headers=with_headers, def_tracing=def_tracing,
|
||||
url_options=url_options)
|
||||
r = self._run(args, intext=intext, with_stats=with_stats,
|
||||
with_profile=with_profile, with_tcpdump=with_tcpdump)
|
||||
if r.exit_code == 0 and with_headers:
|
||||
|
|
@ -1102,8 +1106,10 @@ class CurlClient:
|
|||
def _complete_args(self, urls, timeout=None, options=None,
|
||||
insecure=False, force_resolve=True,
|
||||
alpn_proto: Optional[str] = None,
|
||||
url_options=None,
|
||||
with_headers: bool = True,
|
||||
def_tracing: bool = True):
|
||||
url_sep = []
|
||||
if not isinstance(urls, list):
|
||||
urls = [urls]
|
||||
|
||||
|
|
@ -1129,7 +1135,13 @@ class CurlClient:
|
|||
active_options = options[options.index('--next') + 1:]
|
||||
|
||||
for url in urls:
|
||||
u = urlparse(urls[0])
|
||||
args.extend(url_sep)
|
||||
if url_options is not None:
|
||||
url_sep = ['--next']
|
||||
|
||||
u = urlparse(url)
|
||||
if url_options is not None and url in url_options:
|
||||
args.extend(url_options[url])
|
||||
if options:
|
||||
args.extend(options)
|
||||
if alpn_proto is not None:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue