From bebf3f159ca9578e76f3112cd1a815ef759216f6 Mon Sep 17 00:00:00 2001 From: Drake Date: Thu, 26 Oct 2006 20:07:43 +0000 Subject: [PATCH] Make all LWP user agents use env_proxy. --- docs/changelog/7.x.x.txt | 1 + lib/WebGUI/Asset/Wobject/SyndicatedContent.pm | 1 + lib/WebGUI/Asset/Wobject/WeatherData.pm | 1 + lib/WebGUI/Cache.pm | 1 + lib/WebGUI/Commerce/Payment/ITransact.pm | 2 ++ 5 files changed, 6 insertions(+) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index eb21563a6..cde259181 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -3,6 +3,7 @@ - Added configurable sales tax. (Tiffany Patterson / Elite Marketing) - change: made Text::Aspell optional, nullifying spellchecker if not present - Fixed a bug where logging in/out would cause a blank page display. + - change: made all LWP user agents use env_proxy 7.1.2 - Fixed a bug that caused workflows to fail if collaboration systems and diff --git a/lib/WebGUI/Asset/Wobject/SyndicatedContent.pm b/lib/WebGUI/Asset/Wobject/SyndicatedContent.pm index fe782be4b..5dd1fb185 100644 --- a/lib/WebGUI/Asset/Wobject/SyndicatedContent.pm +++ b/lib/WebGUI/Asset/Wobject/SyndicatedContent.pm @@ -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': " . diff --git a/lib/WebGUI/Asset/Wobject/WeatherData.pm b/lib/WebGUI/Asset/Wobject/WeatherData.pm index 2f49c4457..55d0420df 100644 --- a/lib/WebGUI/Asset/Wobject/WeatherData.pm +++ b/lib/WebGUI/Asset/Wobject/WeatherData.pm @@ -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. diff --git a/lib/WebGUI/Cache.pm b/lib/WebGUI/Cache.pm index 9e35bf63b..8b5d4d60e 100644 --- a/lib/WebGUI/Cache.pm +++ b/lib/WebGUI/Cache.pm @@ -215,6 +215,7 @@ sub setByHTTP { my $url = shift; my $ttl = shift; my $userAgent = new LWP::UserAgent; + $userAgent->env_proxy; $userAgent->agent("WebGUI/".$WebGUI::VERSION); $userAgent->timeout(30); my $header = new HTTP::Headers; diff --git a/lib/WebGUI/Commerce/Payment/ITransact.pm b/lib/WebGUI/Commerce/Payment/ITransact.pm index 0cd328024..c2fb24111 100644 --- a/lib/WebGUI/Commerce/Payment/ITransact.pm +++ b/lib/WebGUI/Commerce/Payment/ITransact.pm @@ -65,6 +65,7 @@ sub cancelRecurringPayment { # Set up a user agent that uses cookies and allows POST redirects $userAgent = LWP::UserAgent->new; + $userAgent->env_proxy; $userAgent->agent("Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0"); push @{ $userAgent->requests_redirectable }, 'POST'; $userAgent->cookie_jar({}); @@ -541,6 +542,7 @@ my $xmlTransactionScript = 'https://secure.paymentclearing.com/cgi-bin/rc/xmltra # Set up LWP to post the XML to iTransact. my $userAgent = LWP::UserAgent->new; + $userAgent->env_proxy; $userAgent->agent("WebGUI "); my $request = HTTP::Request->new(POST => $xmlTransactionScript);