From dbe5f1dfb27913bf4c4eb821875bd312c41059c9 Mon Sep 17 00:00:00 2001 From: KodeStar Date: Tue, 13 Feb 2018 18:44:34 +0000 Subject: [PATCH] Fix nzbget api url not working if missing trailing slash --- app/SupportedApps/Nzbget.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/SupportedApps/Nzbget.php b/app/SupportedApps/Nzbget.php index 0f5a481c..fc28b82f 100644 --- a/app/SupportedApps/Nzbget.php +++ b/app/SupportedApps/Nzbget.php @@ -68,8 +68,10 @@ class Nzbget implements Contracts\Applications, Contracts\Livestats { $rebuild_url = str_replace('http://', 'http://'.$username.':'.$password.'@', $url); $rebuild_url = str_replace('https://', 'https://'.$username.':'.$password.'@', $rebuild_url); + $rebuild_url = rtrim($rebuild_url, '/'); - $api_url = $rebuild_url.'jsonrpc/'.$endpoint; + + $api_url = $rebuild_url.'/jsonrpc/'.$endpoint; $client = new Client(['http_errors' => false]); $res = $client->request('GET', $api_url);