]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
tool_getparam: warn if provided header looks malformed
authorDaniel Stenberg <daniel@haxx.se>
Wed, 1 Oct 2025 11:33:22 +0000 (13:33 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 1 Oct 2025 13:50:43 +0000 (15:50 +0200)
URL: https://fosstodon.org/@galdor/115298664084113519
Closes #18793

src/tool_getparam.c

index eed87bb807d7679a23abfc715be48e6f3c4e211d..60b3b30ad48a07cc380321f139d438ad86fb2d57 100644 (file)
@@ -1267,6 +1267,10 @@ static ParameterError parse_header(struct OperationConfig *config,
     }
   }
   else {
+    if(!strchr(nextarg, ':') && !strchr(nextarg, ';')) {
+      warnf("The provided %s header '%s' does not look like a header?",
+            (cmd == C_PROXY_HEADER) ? "proxy": "HTTP", nextarg);
+    }
     if(cmd == C_PROXY_HEADER) /* --proxy-header */
       err = add2list(&config->proxyheaders, nextarg);
     else