From: Fabian Keil Date: Sun, 13 Dec 2020 08:02:04 +0000 (+0100) Subject: privoxy-regression-test: Skip the connection-established response in get_status_code() X-Git-Tag: v_3_0_30~270^2~11 X-Git-Url: http://www.privoxy.org/gitweb/%20?a=commitdiff_plain;h=ad4ac0a4b5c0b533b3df903943ba2cbd05126021;p=privoxy.git privoxy-regression-test: Skip the connection-established response in get_status_code() ... when looking for the status code with a CGI prefix that starts with https://. We care about the status code sent by the impersonated web server. --- diff --git a/tools/privoxy-regression-test.pl b/tools/privoxy-regression-test.pl index 2d38663f..4c305a35 100755 --- a/tools/privoxy-regression-test.pl +++ b/tools/privoxy-regression-test.pl @@ -1299,10 +1299,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;