[Mapbender-commits] r9711 - trunk/mapbender/owsproxy/http
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Thu Mar 23 07:23:18 PDT 2017
Author: armin11
Date: 2017-03-23 07:23:18 -0700 (Thu, 23 Mar 2017)
New Revision: 9711
Modified:
trunk/mapbender/owsproxy/http/index.php
Log:
Fix for post requests via owsproxy
Modified: trunk/mapbender/owsproxy/http/index.php
===================================================================
--- trunk/mapbender/owsproxy/http/index.php 2017-03-23 14:22:49 UTC (rev 9710)
+++ trunk/mapbender/owsproxy/http/index.php 2017-03-23 14:23:18 UTC (rev 9711)
@@ -952,13 +952,28 @@
global $reqParams, $n;
//debug
$startTime = microtime();
- if (func_num_args() == 4) { //new for HTTP Authentication
- $auth = func_get_arg(3);
- $d = new connector($url, $auth);
+ if ($postData == false) {
+ if (func_num_args() == 4) { //new for HTTP Authentication
+ $auth = func_get_arg(3);
+ $d = new connector($url, $auth);
+ } else {
+ $d = new connector($url);
+ }
+ $content = $d->file;
} else {
- $d = new connector($url);
+ $postInterfaceObject = new connector();
+ $postInterfaceObject->set('httpType','POST');
+ $postInterfaceObject->set('curlSendCustomHeaders',true);
+ $postInterfaceObject->set('httpPostData', $postData);
+ $postInterfaceObject->set('httpContentType','text/xml');
+ if (func_num_args() == 4) { //new for HTTP Authentication
+ $auth = func_get_arg(3);
+ $postInterfaceObject->load($url, $auth);
+ } else {
+ $postInterfaceObject->load($url);
+ }
+ $content = $postInterfaceObject->file;
}
- $content = $d->file;
$endTime = microtime();
//$e = new mb_exception("owsproxy/http/index.php: Time for getting remote resource: ".(string)($endTime - $startTime));
if (strtoupper($reqParams["request"]) == "GETMAP") { // getmap
More information about the Mapbender_commits
mailing list