From c1978963dc28395123e8a2755ed49359a98e96d9 Mon Sep 17 00:00:00 2001
From: Fabian Keil <fk@fabiankeil.de>
Date: Wed, 26 Feb 2020 15:42:48 +0100
Subject: [PATCH] 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
---
 parsers.c | 7 +++++++
 1 file changed, 7 insertions(+)

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.
-- 
2.49.0