headers: set an error message on illegal response headers

Makes it report "Invalid response header" instead of the slightly odd "A
libcurl function was given a bad argument".

Add test 749 and 750 for more CONNECT response testing.

Reported-by: Int64x86 on github
Fixes #17330
Closes #17336
This commit is contained in:
Daniel Stenberg 2025-05-13 11:19:40 +02:00
parent e270881a5d
commit a8b947e7f4
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
4 changed files with 122 additions and 2 deletions

View file

@ -336,8 +336,10 @@ CURLcode Curl_headers_push(struct Curl_easy *data, const char *header,
Curl_llist_append(&data->state.httphdrs, hs, &hs->node);
data->state.prevhead = hs;
}
else
else {
failf(data, "Invalid response header");
free(hs);
}
return result;
}