lib/kolab_api_controller.php lib/kolab_client_api.php

Aleksander Machniak machniak at kolabsys.com
Wed Oct 3 19:00:47 CEST 2012


 lib/kolab_api_controller.php |    2 ++
 lib/kolab_client_api.php     |   11 ++++++++++-
 2 files changed, 12 insertions(+), 1 deletion(-)

New commits:
commit 5bd64ac6ff2efcc89e1c016e671d577693c5c069
Author: Aleksander Machniak <alec at alec.pl>
Date:   Wed Oct 3 18:59:02 2012 +0200

    Fix bug where ssl_* configuration wasn't used when proxying API requests (Bug #1016)

diff --git a/lib/kolab_api_controller.php b/lib/kolab_api_controller.php
index 8e9fc30..bf7058b 100644
--- a/lib/kolab_api_controller.php
+++ b/lib/kolab_api_controller.php
@@ -198,6 +198,8 @@ class kolab_api_controller
         $request->setMethod($method == 'GET' ? HTTP_Request2::METHOD_GET : HTTP_Request2::METHOD_POST);
         $request->setHeader('X-Session-Token', kolab_utils::get_request_header('X-Session-Token'));
 
+        kolab_client_api::configure($request);
+
         if ($method == 'GET') {
             parse_str($_SERVER['QUERY_STRING'], $query);
             unset($query['service']);
diff --git a/lib/kolab_client_api.php b/lib/kolab_client_api.php
index aeb37a5..7405489 100644
--- a/lib/kolab_client_api.php
+++ b/lib/kolab_client_api.php
@@ -60,7 +60,16 @@ class kolab_client_api
     public function init()
     {
         $this->request = new HTTP_Request2();
+        self::configure($this->request);
+    }
 
+    /**
+     * Configure HTTP_Request2 object
+     *
+     * @param HTTP_Request2 $request Request object
+     */
+    public static function configure($request)
+    {
         // Configure connection options
         $config  = Conf::get_instance();
         $options = array(
@@ -75,7 +84,7 @@ class kolab_client_api
         foreach ($options as $optname => $opttype) {
             if (($optvalue = $config->get('kolab_wap', $optname, $opttype)) !== null) {
                 try {
-                    $this->request->setConfig($optname, $optvalue);
+                    $request->setConfig($optname, $optvalue);
                 }
                 catch (Exception $e) {
                     Log::error("HTTP: " . $e->getMessage());





More information about the commits mailing list