diff --git a/api.php b/api.php index 9f4798b..9b8fdc7 100644 --- a/api.php +++ b/api.php @@ -241,7 +241,12 @@ class ZammadClient { private string $token; public function __construct(string $url, string $token) { - $this->url = rtrim($url, '/'); + $url = rtrim($url, '/'); + // Lisää https:// jos protokolla puuttuu + if (!preg_match('#^https?://#i', $url)) { + $url = 'https://' . $url; + } + $this->url = $url; $this->token = $token; }