From: Fabian Keil <fk@fabiankeil.de>
Date: Sun, 13 Dec 2020 07:33:48 +0000 (+0100)
Subject: privoxy-regression-test: Use --proxy-header when using a CGI prefix with https://
X-Git-Tag: v_3_0_30~270^2~12
X-Git-Url: http://www.privoxy.org/gitweb/%22https:/@default-cgi@/man-page/faq/@default-cgi@toggle?a=commitdiff_plain;h=5692d36bfe70f8e0d10833bb2550d998c089f58e;p=privoxy.git

privoxy-regression-test: Use --proxy-header when using a CGI prefix with https://

... and a "Host:" header.
---

diff --git a/tools/privoxy-regression-test.pl b/tools/privoxy-regression-test.pl
index 788d7c45..2d38663f 100755
--- a/tools/privoxy-regression-test.pl
+++ b/tools/privoxy-regression-test.pl
@@ -1403,8 +1403,13 @@ sub get_show_request_with_curl($) {
 
     # Enable the action to test
     $curl_parameters .= '-H \'X-Privoxy-Control: ' . $test->{'tag'} . '\' ';
-    # The header to filter
-    $curl_parameters .= '-H \'' . $header . '\' ';
+
+    # Add the header to filter
+    if ($privoxy_cgi_url =~ m@^https://@ and $header =~ m@^Host:@) {
+        $curl_parameters .= '--proxy-header \'' . $header . '\' ';
+    } else {
+        $curl_parameters .= '-H \'' . $header . '\' ';
+    }
 
     $curl_parameters .= ' ';
     $curl_parameters .= $privoxy_cgi_url;