Fix sabnzbd api url failing if missing trailing slash

This commit is contained in:
KodeStar 2018-02-13 18:48:42 +00:00
parent dbe5f1dfb2
commit 88c36d2b2d

View file

@ -70,7 +70,9 @@ class Sabnzbd implements Contracts\Applications, Contracts\Livestats {
$url = $config->url; $url = $config->url;
$apikey = $config->apikey; $apikey = $config->apikey;
$api_url = $url.'api?output=json&apikey='.$apikey.'&mode='.$endpoint; $url = rtrim($url, '/');
$api_url = $url.'/api?output=json&apikey='.$apikey.'&mode='.$endpoint;
//die( $api_url.' --- '); //die( $api_url.' --- ');
$client = new Client(['http_errors' => false]); $client = new Client(['http_errors' => false]);