Skip to content

Commit 9f04995

Browse files
eserteoalders
authored andcommitted
partially skip live-https.t if there's no keep-alive connection (fix for #57)
live-https.t fails if the test server (www.cpan.org) does not do keep-alive connections. Currently this problem may be reproduced by adding 151.101.246.217 www.cpan.org to /etc/hosts.
1 parent 8e8e1e7 commit 9f04995

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

t/live-https.t

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,11 @@ my $s = Net::HTTPS->new(
3939
MaxLineLength => 512
4040
) || die "$@";
4141

42-
for ( 1 .. 2 ) {
42+
my $connection_is_kept_alive;
43+
SKIP: for my $pass ( 1 .. 2 ) {
44+
skip "No keep-alive connection, cannot do another request", 3
45+
if $pass == 2 && !$connection_is_kept_alive;
46+
4347
$s->write_request(
4448
GET => "/",
4549
'User-Agent' => 'Mozilla/5.0',
@@ -52,6 +56,9 @@ for ( 1 .. 2 ) {
5256
print "# $code $mess\n";
5357
for ( sort keys %h ) {
5458
print "# $_: $h{$_}\n";
59+
if (/^Connection$/i && $h{$_} =~ /^keep-alive$/) {
60+
$connection_is_kept_alive = 1;
61+
}
5562
}
5663
print "#\n";
5764

0 commit comments

Comments
 (0)