diff --git a/lib/urlapi.c b/lib/urlapi.c index d92887bf88..9fd08890f3 100644 --- a/lib/urlapi.c +++ b/lib/urlapi.c @@ -520,7 +520,7 @@ UNITTEST int ipv4_normalize(struct dynbuf *host) int rc; curl_off_t l; if(*c == '0') { - if(c[1] == 'x') { + if(Curl_raw_tolower(c[1]) == 'x') { c += 2; /* skip the prefix */ rc = curlx_str_hex(&c, &l, UINT_MAX); if(rc) diff --git a/tests/libtest/lib1560.c b/tests/libtest/lib1560.c index a62d9334b2..a69511d492 100644 --- a/tests/libtest/lib1560.c +++ b/tests/libtest/lib1560.c @@ -706,6 +706,7 @@ static const struct urltestcase get_url_list[] = { {"https://0xffffffff", "https://255.255.255.255/", 0, 0, CURLUE_OK}, {"https://1.0x1000000", "https://1.0x1000000/", 0, 0, CURLUE_OK}, {"https://0x7f.1", "https://127.0.0.1/", 0, 0, CURLUE_OK}, + {"https://0X7F.1", "https://127.0.0.1/", 0, 0, CURLUE_OK}, {"https://1.2.3.256.com", "https://1.2.3.256.com/", 0, 0, CURLUE_OK}, {"https://10.com", "https://10.com/", 0, 0, CURLUE_OK}, {"https://1.2.com", "https://1.2.com/", 0, 0, CURLUE_OK}, @@ -765,10 +766,12 @@ static const struct urltestcase get_url_list[] = { {"https://16843009", "https://1.1.1.1/", 0, 0, CURLUE_OK}, {"https://0177.1", "https://127.0.0.1/", 0, 0, CURLUE_OK}, {"https://0111.02.0x3", "https://73.2.0.3/", 0, 0, CURLUE_OK}, + {"https://0111.02.0X3", "https://73.2.0.3/", 0, 0, CURLUE_OK}, {"https://0111.02.0x3.", "https://73.2.0.3/", 0, 0, CURLUE_OK}, {"https://0111.02.030", "https://73.2.0.24/", 0, 0, CURLUE_OK}, {"https://0111.02.030.", "https://73.2.0.24/", 0, 0, CURLUE_OK}, {"https://0xff.0xff.0377.255", "https://255.255.255.255/", 0, 0, CURLUE_OK}, + {"https://0XFF.0XFF.0377.255", "https://255.255.255.255/", 0, 0, CURLUE_OK}, {"https://1.0xffffff", "https://1.255.255.255/", 0, 0, CURLUE_OK}, /* IPv4 numerical overflows or syntax errors will not normalize */ {"https://a127.0.0.1", "https://a127.0.0.1/", 0, 0, CURLUE_OK},