fix proxyurl lwp notice

This commit is contained in:
garnier-quentin 2020-02-13 15:12:31 +01:00
parent 43585bb0dc
commit dc74f41988
1 changed files with 2 additions and 1 deletions

View File

@ -109,7 +109,8 @@ sub set_proxy {
} }
if (defined($options{request}->{proxyurl}) && $options{request}->{proxyurl} ne '') { if (defined($options{request}->{proxyurl}) && $options{request}->{proxyurl} ne '') {
my $proxyurl = $options{request}->{proxyurl}; my $proxyurl = $options{request}->{proxyurl};
if ($options{request}->{proto} eq "https" || $options{request}->{full_url} =~ /^https/) { if ($options{request}->{proto} eq "https" ||
(defined($options{request}->{full_url}) && $options{request}->{full_url} =~ /^https/)) {
$proxyurl = 'connect://' . $2 if ($proxyurl =~ /^(http|https):\/\/(.*)/); $proxyurl = 'connect://' . $2 if ($proxyurl =~ /^(http|https):\/\/(.*)/);
} }
$self->{ua}->proxy(['http', 'https'], $proxyurl); $self->{ua}->proxy(['http', 'https'], $proxyurl);