From: Fabian Keil Date: Thu, 19 Jun 2025 10:14:07 +0000 (+0200) Subject: Don't forward unsupported Connection keywords if there are "too many" keywords to... X-Git-Url: http://www.privoxy.org/gitweb/%22https:/@default-cgi@/man-page/faq/@default-cgi@show-status?a=commitdiff_plain;h=68a6961918d3b9847397ed1ee80f76c1a302f28a;p=privoxy.git Don't forward unsupported Connection keywords if there are "too many" keywords to parse --- diff --git a/parsers.c b/parsers.c index 605f54a0..04e7ee00 100644 --- a/parsers.c +++ b/parsers.c @@ -1895,6 +1895,22 @@ static jb_err server_connection(struct client_state *csp, char **header) freez(old_header); } } + else + { + if (strcmpic(*header, "Connection: close")) + { + /* + * This can happen if there are "too many" keywords + * in the connection header. + */ + char *old_header = *header; + + *header = strdup_or_die("Connection: close"); + log_error(LOG_LEVEL_HEADER, "Replaced: \'%s\' with \'%s\'", + old_header, *header); + freez(old_header); + } + } /* Signal server_connection_adder() to return early. */ csp->flags |= CSP_FLAG_SERVER_CONNECTION_HEADER_SET;