From 802bbeda1b7a6d964d8657ee6ff400bbcc25fcbb Mon Sep 17 00:00:00 2001 From: Gingka/Ginger Pepper <33764485+ExperiBass@users.noreply.github.com> Date: Wed, 14 Jun 2023 15:22:11 -0400 Subject: [PATCH] remove trailing slashes from instance url --- src/http.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/http.ts b/src/http.ts index e5e36ce..a0b2732 100644 --- a/src/http.ts +++ b/src/http.ts @@ -155,7 +155,7 @@ export class LemmyHttp { * @param headers optional headers. Should contain `x-real-ip` and `x-forwarded-for` . */ constructor(baseUrl: string, headers?: { [key: string]: string }) { - this.#apiUrl = `${baseUrl}/api/${VERSION}`; + this.#apiUrl = `${baseUrl.replace(/\/+$/, "")}/api/${VERSION}`; this.#pictrsUrl = `${baseUrl}/pictrs/image`; if (headers) {