remove trailing slashes from instance url

This commit is contained in:
Gingka/Ginger Pepper 2023-06-14 15:22:11 -04:00
parent bad0ec49db
commit 802bbeda1b
No known key found for this signature in database
GPG key ID: 5F47E26A5D221AEC

View file

@ -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) {