Skip to content

Commit

Permalink
fix(qbitorrent): url-with-credentials compatibility fix
Browse files Browse the repository at this point in the history
href returns a trailing forward slash, which conflicts with using a static `/api/v2` cat'd for calling qbit.
  • Loading branch information
zakkarry committed Oct 3, 2023
1 parent 5f56065 commit 7b167f8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/clients/QBittorrent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 }),
});
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 7b167f8

Please sign in to comment.