From b45d226352fd912094f6d24e23126df552d91126 Mon Sep 17 00:00:00 2001 From: mserralta <2463025+mserralta@users.noreply.github.com> Date: Mon, 12 Oct 2020 14:32:20 +0200 Subject: [PATCH] API URL is wrong when I use URL with https:// If I init the Client like: ZCRMRestClient::initialize(array( 'access_type' => 'offline', 'accounts_url' => 'https://accounts.zoho.eu', 'apiBaseUrl' => 'https://www.zohoapis.eu' )); I got double https://https:// on curl request. I think the problem is comming from the like I changed! --- src/crm/api/APIRequest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/crm/api/APIRequest.php b/src/crm/api/APIRequest.php index 5c686e57..7a50a946 100644 --- a/src/crm/api/APIRequest.php +++ b/src/crm/api/APIRequest.php @@ -46,7 +46,7 @@ private function __construct($apiHandler) { self::constructAPIUrl($apiHandler); self::setUrl($this->url . $apiHandler->getUrlPath()); - if (substr($apiHandler->getUrlPath(), 0, 4) !== "http") + if (substr($this->url, 0, 4) !== "http") { self::setUrl("https://" . $this->url); } @@ -356,4 +356,4 @@ public function setApiKey($apiKey) { $this->apiKey = $apiKey; } -} \ No newline at end of file +}