[Mapbender-commits] r7630 - trunk/mapbender/http/classes

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Sat Feb 19 05:23:59 EST 2011


Author: armin11
Date: 2011-02-19 02:23:59 -0800 (Sat, 19 Feb 2011)
New Revision: 7630

Modified:
   trunk/mapbender/http/classes/class_connector.php
Log:
Fix problems with firewalls and owsproxy modules

Modified: trunk/mapbender/http/classes/class_connector.php
===================================================================
--- trunk/mapbender/http/classes/class_connector.php	2011-02-19 10:01:17 UTC (rev 7629)
+++ trunk/mapbender/http/classes/class_connector.php	2011-02-19 10:23:59 UTC (rev 7630)
@@ -62,6 +62,18 @@
 	 * Loads content from the given URL.
 	 */
 	public function load($url) {
+		//some firewalls have problems to allow requests from a server behind it to the same server thru an internet connection. It can be that some requests are done thru this class to the urls of HTTP_AUTH_PROXY or OWSPROXY. If some of those are part of the url they must be exchanged with localhost - which hopefully should work. TODO: check if http is ok for all 
+		
+		$posPROXY = strpos($url,OWSPROXY);
+		if ($posPROXY !== false) {
+			$url = str_replace($_SERVER['HTTP_HOST'], "localhost", $url);
+			$url = str_replace("https", "http", $url);
+		}
+		$posPROXY = strpos($url,HTTP_AUTH_PROXY);
+		if ($posPROXY !== false) {
+			$url = str_replace($_SERVER['HTTP_HOST'], "localhost", $url);
+			$url = str_replace("https", "http", $url);
+		}
 		if (!$url) {
 			$e = new mb_exception("connector: no URL given");
 			return false;



More information about the Mapbender_commits mailing list