1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
#!perl -w
use strict;
use Test::More;
use LWP::UserAgent;
my $ua = LWP::UserAgent->new();
plan skip_all => "No internet available on Debian build systems";
exit;
plan skip_all => "Not online" unless $ua->is_online;
plan tests => 5;
my $res = $ua->simple_request(HTTP::Request->new(GET => "https://www.apache.org"));
ok($res->is_success);
my $h = $res->header( 'X-Died' );
is($h, undef, "no X-Died header");
like($res->content, qr/Apache Software Foundation/);
# test for RT #81948
my $warn = '';
$SIG{__WARN__} = sub { $warn = shift };
$ua = LWP::UserAgent->new( ssl_opts => {verify_hostname => 0} );
$res = $ua->simple_request(HTTP::Request->new(GET => "https://www.apache.org"));
ok($res->is_success);
is($warn, '', "no warning seen");
$res->dump(prefix => "# ");
|