From: Fabian Keil <fk@fabiankeil.de>
Date: Wed, 26 Feb 2020 14:42:48 +0000 (+0100)
Subject: sed_https(): Clear the existing tags before calling sed()
X-Git-Tag: v_3_0_29~467
X-Git-Url: http://www.privoxy.org/gitweb/%22https:/@default-cgi@/man-page/static/coding.html?a=commitdiff_plain;h=c1978963dc28395123e8a2755ed49359a98e96d9;p=privoxy.git

sed_https(): Clear the existing tags before calling sed()

This makes sure tagging based on the encrypted client
headers works even if a tag has already been set based
on the unencrypted ones.

Sponsored by: Robert Klemme
---

diff --git a/parsers.c b/parsers.c
index 28121615..6f58c109 100644
--- a/parsers.c
+++ b/parsers.c
@@ -1215,6 +1215,13 @@ jb_err sed_https(struct client_state *csp)
    csp->headers->first = csp->https_headers->first;
    csp->headers->last  = csp->https_headers->last;
 
+   /*
+    * Start with fresh tags. Already exising tags may
+    * be set again. This is necessary to overrule
+    * URL-based patterns.
+    */
+   destroy_list(csp->tags);
+
    /*
     * We want client header filters and taggers
     * so temporarly remove the flag.