mirror of
https://github.com/curl/curl.git
synced 2026-08-25 13:53:37 +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
28
lib/url.c
28
lib/url.c
|
|
@ -590,29 +590,15 @@ static bool proxy_info_matches(const struct proxy_info *data,
|
|||
{
|
||||
if((data->proxytype == needle->proxytype) &&
|
||||
(data->port == needle->port) &&
|
||||
curl_strequal(data->host.name, needle->host.name))
|
||||
curl_strequal(data->host.name, needle->host.name)) {
|
||||
|
||||
if(Curl_timestrcmp(data->user, needle->user) ||
|
||||
Curl_timestrcmp(data->passwd, needle->passwd))
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static bool socks_proxy_info_matches(const struct proxy_info *data,
|
||||
const struct proxy_info *needle)
|
||||
{
|
||||
if(!proxy_info_matches(data, needle))
|
||||
return FALSE;
|
||||
|
||||
/* the user information is case-sensitive
|
||||
or at least it is not defined as case-insensitive
|
||||
see https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.1 */
|
||||
|
||||
/* curl_strequal does a case insensitive comparison,
|
||||
so do not use it here! */
|
||||
if(Curl_timestrcmp(data->user, needle->user) ||
|
||||
Curl_timestrcmp(data->passwd, needle->passwd))
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* A connection has to have been idle for less than 'conn_max_idle_ms'
|
||||
|
|
@ -923,7 +909,7 @@ static bool url_match_proxy_use(struct connectdata *conn,
|
|||
return FALSE;
|
||||
|
||||
if(m->needle->bits.socksproxy &&
|
||||
!socks_proxy_info_matches(&m->needle->socks_proxy, &conn->socks_proxy))
|
||||
!proxy_info_matches(&m->needle->socks_proxy, &conn->socks_proxy))
|
||||
return FALSE;
|
||||
|
||||
if(m->needle->bits.httpproxy) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue