diff options
Diffstat (limited to 'lib/PublicInbox/LeiCurl.pm')
-rw-r--r-- | lib/PublicInbox/LeiCurl.pm | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/PublicInbox/LeiCurl.pm b/lib/PublicInbox/LeiCurl.pm index 5ffade99..48c66ee9 100644 --- a/lib/PublicInbox/LeiCurl.pm +++ b/lib/PublicInbox/LeiCurl.pm @@ -1,4 +1,4 @@ -# Copyright (C) 2021 all contributors <meta@public-inbox.org> +# Copyright (C) all contributors <meta@public-inbox.org> # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt> # common option and torsocks(1) wrapping for curl(1) @@ -7,8 +7,7 @@ # n.b. curl may support a daemon/client model like lei someday: # https://github.com/curl/curl/wiki/curl-tool-master-client package PublicInbox::LeiCurl; -use strict; -use v5.10.1; +use v5.12; use PublicInbox::Spawn qw(which); use PublicInbox::Config; @@ -27,7 +26,7 @@ sub new { my ($cls, $lei, $curl) = @_; $curl //= which('curl') // return $lei->fail('curl not found'); my $opt = $lei->{opt}; - my @cmd = ($curl, qw(-Sf)); + my @cmd = ($curl, qw(-gSf)); $cmd[-1] .= 's' if $opt->{quiet}; # already the default for "lei q" $cmd[-1] .= 'v' if $opt->{verbose}; # we use ourselves, too for my $o ($lei->curl_opt) { @@ -77,8 +76,8 @@ sub for_uri { my $pfx = torsocks($self, $lei, $uri) or return; # error if ($uri->scheme =~ /\Ahttps?\z/i) { my $cfg = $lei->_lei_cfg; - my $p = $cfg ? $cfg->urlmatch('http.Proxy', $$uri) : undef; - push(@opt, "--proxy=$p") if defined($p); + my $p = $cfg ? $cfg->urlmatch('http.Proxy', $$uri, 1) : undef; + push(@opt, '--proxy', $p) if defined($p); } bless [ @$pfx, @$self, @opt, $uri->as_string ], ref($self); } |