From ad4ac0a4b5c0b533b3df903943ba2cbd05126021 Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Sun, 13 Dec 2020 09:02:04 +0100 Subject: [PATCH] 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. --- tools/privoxy-regression-test.pl | 10 ++++++++++ 1 file changed, 10 insertions(+) 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; -- 2.39.2