]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
urlapi: remove superfluous host name check
authorDaniel Stenberg <daniel@haxx.se>
Wed, 24 May 2023 11:50:25 +0000 (13:50 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 25 May 2023 06:30:20 +0000 (08:30 +0200)
... as it is checked later more proper.

Closes #11195

lib/urlapi.c
tests/libtest/lib1560.c

index ab62773d376fa9271c0370dc7e6b44532aff0c66..a4530f919a8ebb8aad7dd47d5907f1540f7eba59 100644 (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;
index 180bea9f2bb213afe490b73c78357a5caefe9e75..7ce3aaede7abf213c314c9ebcd4ee792c49b8e49 100644 (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,",
    "",