You are here: Foswiki>Tasks Web>Item1956 (14 Sep 2009, MichaelDaum)Edit Attach

Item1956: ImagePlugin takes proxy settings from environment instead of Foswiki

pencil
Priority: Normal
Current State: Closed
Released In:
Target Release: n/a
Applies To: Extension
Component: ImagePlugin
Branches:
Reported By: AndreLichtsteiner
Waiting For:
Last Change By: MichaelDaum
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

ItemTemplate edit

Summary ImagePlugin takes proxy settings from environment instead of Foswiki
ReportedBy AndreLichtsteiner
Codebase
SVN Range Foswiki-1.0.0, Thu, 08 Jan 2009, build 1878
AppliesTo Extension
Component ImagePlugin
Priority Normal
CurrentState Closed
WaitingFor
Checkins ImagePlugin:a7eac68cecbe
TargetRelease n/a
ReleasedIn
Topic revision: r2 - 14 Sep 2009, MichaelDaum
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy