mirror of
https://github.com/LemmyNet/lemmy-js-client.git
synced 2024-11-01 01:59:55 +00:00
Merge pull request #135 from ExperiBass/trim-trailing-slash
remove trailing slashes from instance url
This commit is contained in:
commit
80bdd21eae
1 changed files with 1 additions and 1 deletions
|
@ -155,7 +155,7 @@ export class LemmyHttp {
|
||||||
* @param headers optional headers. Should contain `x-real-ip` and `x-forwarded-for` .
|
* @param headers optional headers. Should contain `x-real-ip` and `x-forwarded-for` .
|
||||||
*/
|
*/
|
||||||
constructor(baseUrl: string, headers?: { [key: string]: string }) {
|
constructor(baseUrl: string, headers?: { [key: string]: string }) {
|
||||||
this.#apiUrl = `${baseUrl}/api/${VERSION}`;
|
this.#apiUrl = `${baseUrl.replace(/\/+$/, "")}/api/${VERSION}`;
|
||||||
this.#pictrsUrl = `${baseUrl}/pictrs/image`;
|
this.#pictrsUrl = `${baseUrl}/pictrs/image`;
|
||||||
|
|
||||||
if (headers) {
|
if (headers) {
|
||||||
|
|
Loading…
Reference in a new issue