From 7b167f863eb6cb0966ca4059091925dad9df0a34 Mon Sep 17 00:00:00 2001 From: zakary <123845855+zakkarry@users.noreply.github.com> Date: Tue, 3 Oct 2023 02:18:19 -0500 Subject: [PATCH] fix(qbitorrent): url-with-credentials compatibility fix href returns a trailing forward slash, which conflicts with using a static `/api/v2` cat'd for calling qbit. --- src/clients/QBittorrent.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/clients/QBittorrent.ts b/src/clients/QBittorrent.ts index 36e24776e..46730110c 100644 --- a/src/clients/QBittorrent.ts +++ b/src/clients/QBittorrent.ts @@ -98,7 +98,7 @@ export default class QBittorrent implements TorrentClient { let response: Response; try { - response = await fetch(`${href}/api/v2/auth/login`, { + response = await fetch(`${href}api/v2/auth/login`, { method: "POST", body: new URLSearchParams({ username, password }), }); @@ -140,7 +140,7 @@ export default class QBittorrent implements TorrentClient { const { qbittorrentUrl } = getRuntimeConfig(); const { href } = extractCredentialsFromUrl(qbittorrentUrl).unwrapOrThrow(); - const response = await fetch(`${href}/api/v2${path}`, { + const response = await fetch(`${href}api/v2${path}`, { method: "post", headers: { Cookie: this.cookie, ...headers }, body,