Item1956: ImagePlugin takes proxy settings from environment instead of Foswiki
Priority: Normal
Current State: Closed
Released In:
Target Release: n/a
Patch, so that ImagePlugin takes proxy settings from Foswiki:
--- D:/lib/Foswiki/Plugins/ImagePlugin/Core.pm orig Fri Jul 03 22:10:52 2009
+++ D:/lib/Foswiki/Plugins/ImagePlugin/Core.pm Fri Aug 21 14:34:15 2009
@@ -603,3 +603,16 @@
$ua->timeout(10);
- $ua->env_proxy;
+
+ my $proxyHost = Foswiki::Func::getPreferencesValue('PROXYHOST') || '';
+ my $proxyPort = Foswiki::Func::getPreferencesValue('PROXYPORT') || '';
+ $proxyHost ||= $Foswiki::cfg{PROXY}{HOST};
+ $proxyPort ||= $Foswiki::cfg{PROXY}{PORT};
+ my $proxySkip = $Foswiki::cfg{PROXY}{SkipProxyForDomains} || '';
+
+ if( $proxyHost && $proxyPort ) {
+ my $proxyURL = "$proxyHost:$proxyPort/";
+ $proxyURL = 'http://' . $proxyURL unless( $proxyURL =~ /^https?:\/\// );
+ $ua->proxy( "http", $proxyURL );
+ my @skipDomains = split( /[\,\s]+/, $proxySkip );
+ $ua->no_proxy( @skipDomains );
+ }
The code was taken from HeadlinesPlugin.
--
AndreLichtsteiner - 21 Aug 2009
Merged in your patch ... a bit different.
--
MichaelDaum - 14 Sep 2009