]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
lib1560: test with leading zeroes and more IPv4 versions
authorDaniel Stenberg <daniel@haxx.se>
Wed, 17 Apr 2024 13:00:00 +0000 (15:00 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 17 Apr 2024 20:45:24 +0000 (22:45 +0200)
Inspired by WHATWG URL Spec test inputs

Closes #13400

tests/libtest/lib1560.c

index 66f944d0d6f107f2ff60ba5e4911e8a96aab8255..5e693390d141b4f2a3445aca6c17890a8e40de9d 100644 (file)
@@ -508,6 +508,17 @@ static const struct testcase get_parts_list[] ={
 };
 
 static const struct urltestcase get_url_list[] = {
+  /* WHATWG disgrees, it wants "https:/0.0.0.0/" */
+  {"https://0x.0x.0", "https://0x.0x.0/", 0, 0, CURLUE_OK},
+
+  {"https://example.com:000000000000000000000443/foo",
+   "https://example.com/foo",
+   0, CURLU_NO_DEFAULT_PORT, CURLUE_OK},
+  {"https://example.com:000000000000000000000/foo",
+   "https://example.com:0/foo",
+   0, CURLU_NO_DEFAULT_PORT, CURLUE_OK},
+  {"https://192.0x0000A80001", "https://192.168.0.1/", 0, 0, CURLUE_OK},
+  {"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://1.2.3.256.com", "https://1.2.3.256.com/", 0, 0, CURLUE_OK},