privoxy-regression-test: Use --proxy-header when using a CGI prefix with https://
authorFabian Keil <fk@fabiankeil.de>
Sun, 13 Dec 2020 07:33:48 +0000 (08:33 +0100)
committerFabian Keil <fk@fabiankeil.de>
Mon, 14 Dec 2020 07:49:17 +0000 (08:49 +0100)
... and a "Host:" header.

tools/privoxy-regression-test.pl

index 788d7c4..2d38663 100755 (executable)
@@ -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;