tool_getparam: warn if provided header looks malformed

URL: https://fosstodon.org/@galdor/115298664084113519
Closes #18793
This commit is contained in:
Daniel Stenberg 2025-10-01 13:33:22 +02:00
parent 150567b0d2
commit b2ae19eed4
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2

View 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