Make all LWP user agents use env_proxy.
This commit is contained in:
parent
153b13207f
commit
bebf3f159c
5 changed files with 6 additions and 0 deletions
|
|
@ -296,6 +296,7 @@ sub _get_rss_data {
|
|||
$rss = Storable::thaw($rss_serial);
|
||||
} else {
|
||||
my $ua = LWP::UserAgent->new(timeout => 5);
|
||||
$ua->env_proxy;
|
||||
my $response = $ua->get($url);
|
||||
if (!$response->is_success()) {
|
||||
$session->errorHandler->warn("Error retrieving url '$url': " .
|
||||
|
|
|
|||
|
|
@ -90,6 +90,7 @@ sub _getLocationData {
|
|||
unless ($locData->{cityState}) {
|
||||
my $oldagent;
|
||||
my $ua = LWP::UserAgent->new;
|
||||
$ua->env_proxy;
|
||||
$ua->timeout(10);
|
||||
$oldagent = $ua->agent();
|
||||
$ua->agent($self->session->env->get("HTTP_USER_AGENT")); # Act as a proxy.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue