urlapi: remove superfluous host name check

... as it is checked later more proper.

Closes #11195
This commit is contained in:
Daniel Stenberg 2023-05-24 13:50:25 +02:00
parent 5c58cb0212
commit 6375a65433
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2
2 changed files with 7 additions and 6 deletions

View File

@ -1724,15 +1724,10 @@ CURLUcode curl_url_set(CURLU *u, CURLUPart what,
case CURLUPART_OPTIONS:
storep = &u->options;
break;
case CURLUPART_HOST: {
size_t len = strcspn(part, " \r\n");
if(strlen(part) != len)
/* hostname with bad content */
return CURLUE_BAD_HOSTNAME;
case CURLUPART_HOST:
storep = &u->host;
Curl_safefree(u->zoneid);
break;
}
case CURLUPART_ZONEID:
storep = &u->zoneid;
break;

View File

@ -697,6 +697,12 @@ static int checkurl(const char *org, const char *url, const char *out)
/* !checksrc! disable SPACEBEFORECOMMA 1 */
static const struct setcase set_parts_list[] = {
{"https://example.com/",
"host=example.com%2fmoo,",
"",
0, /* get */
0, /* set */
CURLUE_OK, CURLUE_BAD_HOSTNAME},
{"https://example.com/",
"host=http://fake,",
"",