[Mapbender-commits] r8096 - in trunk/mapbender: conf http/classes

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon Sep 5 05:50:31 EDT 2011


Author: astrid_emde
Date: 2011-09-05 02:50:31 -0700 (Mon, 05 Sep 2011)
New Revision: 8096

Modified:
   trunk/mapbender/conf/mapbender.conf-dist
   trunk/mapbender/http/classes/class_connector.php
Log:
owsproxy - new variable in mapbender.conf to use localhost with owsproxy if the request comes from the same server

Modified: trunk/mapbender/conf/mapbender.conf-dist
===================================================================
--- trunk/mapbender/conf/mapbender.conf-dist	2011-09-05 09:44:03 UTC (rev 8095)
+++ trunk/mapbender/conf/mapbender.conf-dist	2011-09-05 09:50:31 UTC (rev 8096)
@@ -51,8 +51,10 @@
 # --------------------------------------------
 # URL to owsproxy
 # (no terminating slash)
+# OWSPROXY_USE_LOCALHOST - use 127.0.0.1 and http for the requests if possible
 # --------------------------------------------
 define("OWSPROXY", "http://<ip or name>/owsproxy");
+define("OWSPROXY_USE_LOCALHOST", false);
 
 # --------------------------------------------
 # Definitions for HTTP Authentication

Modified: trunk/mapbender/http/classes/class_connector.php
===================================================================
--- trunk/mapbender/http/classes/class_connector.php	2011-09-05 09:44:03 UTC (rev 8095)
+++ trunk/mapbender/http/classes/class_connector.php	2011-09-05 09:50:31 UTC (rev 8096)
@@ -62,22 +62,19 @@
 	 * 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 127.0.0.1 - which hopefully should work. TODO: check if http is ok for all 
+		//some firewalls have problems to allow requests from a server behind it to the same server through 
+		//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 127.0.0.1 - 			//which hopefully should work. 
+		//TODO: check if http is ok for all 
 		$posPROXY = strpos($url,OWSPROXY);
 		//$e = new mb_exception('class_connector: old url: '.$url);
-		if ($posPROXY !== false) {
+ 		if($posPROXY !== false && OWSPROXY_USE_LOCALHOST == true){
 			$e = new mb_notice('class_connector: old url: '.$url);	
 			$url = str_replace($_SERVER['HTTP_HOST'], "127.0.0.1", $url);
 			$url = str_replace("https", "http", $url);//localhost no https should needed - it will be faster without
 			$e = new mb_notice('class_connector: new url: '.$url);
 		}
-		/*$posPROXY = strpos($url,HTTP_AUTH_PROXY);
-		if ($posPROXY !== false) {
-			$e = new mb_exception('class_connector: old url: '.$url);
-			$url = str_replace($_SERVER['HTTP_HOST'], "localhost", $url);
-			$url = str_replace("https", "http", $url);
-			$e = new mb_exception('class_connector: new url: '.$url);
-		}*/
+
 		$e = new mb_notice('class_connector: load url: '.$url);
 		if (!$url) {
 			$e = new mb_exception("connector: no URL given");



More information about the Mapbender_commits mailing list