return ipv6_parse(u, hostname, hlen);
else {
/* letters from the second string are not ok */
- len = strcspn(hostname, " \r\n\t/:#?!@{}[]\\$\'\"^`*<>=;,+&()%");
+ len = strcspn(hostname, " \r\n\t/:#?!@{}[]\\$\'\"^`*<>=;,+&()%|");
if(hlen != len)
/* hostname with bad content */
return CURLUE_BAD_HOSTNAME;
{"https://user@example.net?he l lo",
"https | user | [12] | [13] | example.net | [15] | / | he l lo | [17]",
CURLU_ALLOW_SPACE, 0, CURLUE_OK},
+ {"https://exam|ple.net", "", 0, 0, CURLUE_BAD_HOSTNAME},
{"https://exam{}[]ple.net", "", 0, 0, CURLUE_BAD_HOSTNAME},
{"https://exam{ple.net", "", 0, 0, CURLUE_BAD_HOSTNAME},
{"https://exam}ple.net", "", 0, 0, CURLUE_BAD_HOSTNAME},