[Privoxy-commits] [privoxy] 04/07: If the server sends multiple Connection headers, only parse and forward the first one

User Git git at git.privoxy.org
Tue Jun 24 14:10:23 CEST 2025


This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch master
in repository privoxy.

commit eee40a90f1132c4c0ae91f6e3c5ab7b8d4cbd2e5
Author: Fabian Keil <fk at fabiankeil.de>
AuthorDate: Sun Jun 22 10:57:09 2025 +0200

    If the server sends multiple Connection headers, only parse and forward the first one
---
 parsers.c | 8 ++++++++
 1 file changed, 8 insertions(+)

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)

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Privoxy-commits mailing list