sed_https(): Clear the existing tags before calling sed()
[privoxy.git] / parsers.c
index 565b21c..6f58c10 100644 (file)
--- a/parsers.c
+++ b/parsers.c
@@ -1185,7 +1185,7 @@ jb_err sed(struct client_state *csp, int filter_server_headers)
 }
 
 
-#ifdef FEATURE_HTTPS_FILTERING
+#ifdef FEATURE_HTTPS_INSPECTION
 /*********************************************************************
  *
  * Function    :  sed_https
@@ -1215,14 +1215,27 @@ 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.
+    */
+   csp->flags &= ~CSP_FLAG_CLIENT_HEADER_PARSING_DONE;
    err = sed(csp, FILTER_CLIENT_HEADERS);
+   csp->flags |= CSP_FLAG_CLIENT_HEADER_PARSING_DONE;
 
    csp->headers->first = headers.first;
    csp->headers->last  = headers.last;
 
    return err;
 }
-#endif /* def FEATURE_HTTPS_FILTERING */
+#endif /* def FEATURE_HTTPS_INSPECTION */
 
 
 /*********************************************************************
@@ -4532,7 +4545,7 @@ jb_err get_destination_from_headers(const struct list *headers, struct http_requ
 }
 
 
-#ifdef FEATURE_HTTPS_FILTERING
+#ifdef FEATURE_HTTPS_INSPECTION
 /*********************************************************************
  *
  * Function    :  get_destination_from_https_headers
@@ -4611,7 +4624,7 @@ jb_err get_destination_from_https_headers(const struct list *headers, struct htt
    return JB_ERR_OK;
 
 }
-#endif /* def FEATURE_HTTPS_FILTERING */
+#endif /* def FEATURE_HTTPS_INSPECTION */
 
 
 /*********************************************************************