From: Fabian Keil Date: Mon, 10 Feb 2025 11:05:22 +0000 (+0100) Subject: Don't forward connection options Privoxy doesn't understand X-Git-Url: http://www.privoxy.org/gitweb/%22https:/@default-cgi@/man-page/static/@default-cgi@edit-actions-add-url-form?a=commitdiff_plain;h=6260031edfde3b3f3129c01097a814e044f2a17e;p=privoxy.git Don't forward connection options Privoxy doesn't understand --- diff --git a/parsers.c b/parsers.c index 944a932f..605f54a0 100644 --- a/parsers.c +++ b/parsers.c @@ -1870,8 +1870,20 @@ static jb_err server_connection(struct client_state *csp, char **header) if ((csp->flags & CSP_FLAG_CLIENT_CONNECTION_KEEP_ALIVE)) { - log_error(LOG_LEVEL_HEADER, - "Keeping the server header '%s' around.", *header); + if (!strcmpic(*header, "Connection: keep-alive")) + { + log_error(LOG_LEVEL_HEADER, + "Keeping the server header '%s' around.", *header); + } + else + { + char *old_header = *header; + + *header = strdup_or_die("Connection: keep-alive"); + log_error(LOG_LEVEL_HEADER, "Replaced: \'%s\' with \'%s\'", + old_header, *header); + freez(old_header); + } } else #endif /* FEATURE_CONNECTION_KEEP_ALIVE */