X-Git-Url: http://www.privoxy.org/gitweb/?a=blobdiff_plain;f=tools%2Fprivoxy-regression-test.pl;h=49d2804fd30d38ab90bc420dca882c0732813ab7;hb=8cdecfe47b6c2d2b5ee64d4e5fda4ca7a1de4f0e;hp=788d7c459246289e1959e75f5ed3e30db3b64cb5;hpb=2b03321a84e7ee1642c248c24325da40d3956566;p=privoxy.git diff --git a/tools/privoxy-regression-test.pl b/tools/privoxy-regression-test.pl index 788d7c45..49d2804f 100755 --- a/tools/privoxy-regression-test.pl +++ b/tools/privoxy-regression-test.pl @@ -47,7 +47,8 @@ use constant { CLI_LOOPS => 1, CLI_MAX_TIME => 5, CLI_MIN_LEVEL => 0, - # XXX: why limit at all? + # The reason for a maximum test level is explained in the + # perldoc section TEST LEVELS near the end of this file. CLI_MAX_LEVEL => 100, CLI_FORKS => 0, CLI_SLEEP_TIME => 0, @@ -1299,10 +1300,20 @@ sub get_server_header($$) { sub get_status_code($) { my $buffer_ref = shift; + our $privoxy_cgi_url; + + my $skip_connection_established_response = $privoxy_cgi_url =~ m@^https://@; my @buffer = @{$buffer_ref}; foreach (@buffer) { + if ($skip_connection_established_response) { + + next if (m@^HTTP/1\.1 200 Connection established@); + next if (m@^\r\n$@); + $skip_connection_established_response = 0; + } + if (/^HTTP\/\d\.\d (\d{3})/) { return $1; @@ -1403,8 +1414,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;