From a93b10cb66229d593d17c0694660318b5664cd39 Mon Sep 17 00:00:00 2001 From: pbarroca <pbarroca@afi-sa.fr> Date: Thu, 26 Nov 2015 19:39:28 +0100 Subject: [PATCH] rel #33756 : fix implementation --- library/Class/WebService/SIGB/AbstractRESTService.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/library/Class/WebService/SIGB/AbstractRESTService.php b/library/Class/WebService/SIGB/AbstractRESTService.php index d5bbd8f22a3..857648b2660 100644 --- a/library/Class/WebService/SIGB/AbstractRESTService.php +++ b/library/Class/WebService/SIGB/AbstractRESTService.php @@ -37,10 +37,18 @@ abstract class Class_WebService_SIGB_AbstractRESTService extends Class_WebServic * @return Class_WebService_SIGB_AbstractRESTService */ public function setServerRoot($server_root) { - $this->_server_root = $server_root; + $this->_server_root = $this->_withProtocol($server_root); return $this; } + + protected function _withProtocol($url) { + return ('http://' == substr($url, 0, 7) || 'https://' == substr($url, 0, 8) + ? '' : 'http://') + . $url; + } + + /** * @return string */ -- GitLab