From b5ff9a37f0f193803df63ce85a7d1e66aa972de1 Mon Sep 17 00:00:00 2001 From: David von Oheimb Date: Thu, 1 Aug 2024 13:31:18 +0200 Subject: [PATCH] fixup! 80-test_cmp_http.t: make -no_proxy cover the IPv6 case '::1' --- test/recipes/80-test_cmp_http.t | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/recipes/80-test_cmp_http.t b/test/recipes/80-test_cmp_http.t index 21c19edf95bb9b..377e08e0d06325 100644 --- a/test/recipes/80-test_cmp_http.t +++ b/test/recipes/80-test_cmp_http.t @@ -252,14 +252,16 @@ sub load_tests { next LOOP if $server_tls == 0 && $line =~ m/,\s*-tls_used\s*,/; my $noproxy = $no_proxy; + my $serverhost = $server_host; + $serverhost = $1 if $serverhost =~ m/^\[(.*)\]$/; if ($line =~ m/,\s*-no_proxy\s*,(.*?)(,|$)/) { $noproxy = $1; - } elsif ($server_host eq "127.0.0.1" || $server_host eq "[::1]") { + } elsif ($server_host eq "127.0.0.1" || $serverhost eq "::1") { # do connections to localhost (e.g., mock server) without proxy - $line =~ s{-section,,}{-section,,-no_proxy,$server_host,} ; + $line =~ s{-section,,}{-section,,-no_proxy,$serverhost,} ; } if ($line =~ m/,\s*-proxy\s*,/) { - next LOOP if $no_proxy && ($noproxy =~ $server_host); + next LOOP if $no_proxy && ($noproxy =~ $serverhost); } else { $line =~ s{-section,,}{-section,,-proxy,$proxy,}; }