NO_PROXY: fix for IPv6 numericals in the URL

Added test 1265 that verifies.

Reported-by: steelman on github
Fixes #2353
Closes #2355
This commit is contained in:
Daniel Stenberg 2018-03-03 14:12:35 +01:00
parent 8b0b1a3088
commit b7f90470be
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
3 changed files with 63 additions and 2 deletions

View file

@ -2574,7 +2574,15 @@ static bool check_noproxy(const char *name, const char *no_proxy)
/* NO_PROXY was specified and it wasn't just an asterisk */
no_proxy_len = strlen(no_proxy);
endptr = strchr(name, ':');
if(name[0] == '[') {
/* IPv6 numerical address */
endptr = strchr(name, ']');
if(!endptr)
return FALSE;
name++;
}
else
endptr = strchr(name, ':');
if(endptr)
namelen = endptr - name;
else