http-proxy: verify CONNECT response headers

Verifed by test 2107

Closes #21927
This commit is contained in:
alhudz 2026-06-09 16:26:14 +05:30 committed by Daniel Stenberg
parent c7cba2fd2d
commit 62b118cf22
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
3 changed files with 56 additions and 1 deletions

View file

@ -476,6 +476,12 @@ static CURLcode single_header(struct Curl_cfilter *cf,
/* output debug if that is requested */
Curl_debug(data, CURLINFO_HEADER_IN, linep, line_len);
/* a CONNECT response line is handed to the client as a header, so it must
pass the same checks as a regular response header before delivery */
result = Curl_verify_header(data, linep, line_len);
if(result)
return result;
/* send the header to the callback */
writetype = CLIENTWRITE_HEADER | CLIENTWRITE_CONNECT |
(ts->headerlines == 1 ? CLIENTWRITE_STATUS : 0);