summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/kolab_client_task.php8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/kolab_client_task.php b/lib/kolab_client_task.php
index 3936dac..00b74b7 100644
--- a/lib/kolab_client_task.php
+++ b/lib/kolab_client_task.php
@@ -139,12 +139,10 @@ class kolab_client_task
{
$url = $this->config_get('api_url', '');
- // TODO: Debug logging
- //console($url);
-
if (!$url) {
- $url = kolab_utils::https_check() ? 'https://' : 'http://';
- $url .= $_SERVER['SERVER_NAME'];
+ $port = $_SERVER['SERVER_PORT'];
+ $url = kolab_utils::https_check() ? 'https://' : 'http://';
+ $url .= $_SERVER['SERVER_NAME'] . ($port ? ":$port" : '');
$url .= preg_replace('/\/?\?.*$/', '', $_SERVER['REQUEST_URI']);
$url .= '/api';
}