[Mapbender-commits] r8095 - in branches/2.7: conf http/classes
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Mon Sep 5 05:44:04 EDT 2011
Author: astrid_emde
Date: 2011-09-05 02:44:03 -0700 (Mon, 05 Sep 2011)
New Revision: 8095
Modified:
branches/2.7/conf/mapbender.conf-dist
branches/2.7/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: branches/2.7/conf/mapbender.conf-dist
===================================================================
--- branches/2.7/conf/mapbender.conf-dist 2011-08-31 15:15:19 UTC (rev 8094)
+++ branches/2.7/conf/mapbender.conf-dist 2011-09-05 09:44:03 UTC (rev 8095)
@@ -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", "http://localhost/owsproxy");
+define("OWSPROXY_USE_LOCALHOST", false);
# --------------------------------------------
# Definitions for HTTP Authentication
Modified: branches/2.7/http/classes/class_connector.php
===================================================================
--- branches/2.7/http/classes/class_connector.php 2011-08-31 15:15:19 UTC (rev 8094)
+++ branches/2.7/http/classes/class_connector.php 2011-09-05 09:44:03 UTC (rev 8095)
@@ -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