From: Fabian Keil Date: Sun, 22 Jun 2025 08:57:09 +0000 (+0200) Subject: If the server sends multiple Connection headers, only parse and forward the first one X-Git-Url: http://www.privoxy.org/gitweb/%22https:/@default-cgi@/man-page/faq/@default-cgi@show-status?a=commitdiff_plain;h=eee40a90f1132c4c0ae91f6e3c5ab7b8d4cbd2e5;p=privoxy.git If the server sends multiple Connection headers, only parse and forward the first one --- diff --git a/parsers.c b/parsers.c index 3be2addf..37bbc138 100644 --- a/parsers.c +++ b/parsers.c @@ -1857,6 +1857,14 @@ static int keep_alive_keyword_detected(const char *header) *********************************************************************/ static jb_err server_connection(struct client_state *csp, char **header) { + if ((csp->flags & CSP_FLAG_SERVER_CONNECTION_HEADER_SET) != 0) + { + log_error(LOG_LEVEL_HEADER, + "Removing \'%s\' header to only parse and forward one.", *header); + freez(*header); + + return JB_ERR_OK; + } if (keep_alive_keyword_detected(*header) #ifdef FEATURE_CONNECTION_KEEP_ALIVE && !(csp->flags & CSP_FLAG_SERVER_SOCKET_TAINTED)