lib1560: verify a few more URL variations

Closes #21842
This commit is contained in:
Daniel Stenberg 2026-06-02 10:58:15 +02:00
parent d2f8e231a7
commit 9d19b47302
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
2 changed files with 46 additions and 1 deletions

View file

@ -37,7 +37,7 @@ lib%TESTNUMBER
success
</stdout>
<limits>
Allocations: 3250
Allocations: 3350
</limits>
</verify>
</testcase>

View file

@ -626,6 +626,51 @@ static const struct testcase get_parts_list[] = {
};
static const struct urltestcase get_url_list[] = {
/* IPvFuture format */
{"http://[v1.fe80::abcd]/", "", 0, 0, CURLUE_BAD_IPV6},
/* trailing dot on valid host */
{"http://example.com./", "http://example.com./", 0, 0, CURLUE_OK},
/* the exact upper valid port boundary */
{"http://host:65535/", "http://host:65535/", 0, 0, CURLUE_OK},
/* Internationalized path (not host). */
{"https://example.com/r\xc3\xa4ksm\xc3\xb6rg\xc3\xa5s",
"https://example.com/r%C3%A4ksm%C3%B6rg%C3%A5s",
CURLU_URLENCODE, 0, CURLUE_OK},
/* weird fragments */
{"http://host/#a#b", "http://host/#a#b", 0, 0, CURLUE_OK},
/* Empty query parameter values */
{"http://host/?a=", "http://host/?a=", 0, 0, CURLUE_OK},
{"http://host/?a=&b=", "http://host/?a=&b=", 0, 0, CURLUE_OK},
/* Percent-encoded userinfo */
{"https://user%20name@example.com/", "https://user%20name@example.com/",
0, 0, CURLUE_OK},
{"https://user:pa%3Ass@example.com/", "https://user:pa%3Ass@example.com/",
0, 0, CURLUE_OK},
/* malformed unbracketed IPv6 */
{"https://fe80:8080::1/", "", 0, 0, CURLUE_BAD_PORT_NUMBER},
{"https://::1/", "", 0, 0, CURLUE_BAD_PORT_NUMBER},
/* Empty host with standard schemes */
{"http:///", "", 0, 0, CURLUE_NO_HOST},
{"https://?q=1", "", 0, 0, CURLUE_NO_HOST},
/* Empty path segment normalization */
{"http://example.com//", "http://example.com//", 0, 0, CURLUE_OK},
{"http://example.com///foo", "http://example.com///foo", 0, 0, CURLUE_OK},
/* Empty user and password combinations */
{"http://@example.com/", "http://@example.com/", 0, 0, CURLUE_OK},
{"http://user:@example.com/", "http://user:@example.com/", 0, 0, CURLUE_OK},
{"http://:password@example.com/", "http://:password@example.com/",
0, 0, CURLUE_OK},
{"https://127.1.0x", "https://127.1.0x/", 0, 0, CURLUE_OK},
{"https://127.0x", "https://127.0x/", 0, 0, CURLUE_OK},
{"https://127.0x.1", "https://127.0x.1/", 0, 0, CURLUE_OK},