From 638d180af257680453bba80f4becd5dc316b32ce Mon Sep 17 00:00:00 2001 From: PleahMaCaka Date: Mon, 23 Oct 2023 00:37:47 +0900 Subject: [PATCH] fix(Client)!: handle possible trailing slash omission in URI --- package.json | 2 +- src/Client.ts | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index c7c654a..6ea6387 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "booga.js", - "version": "0.2.0", + "version": "0.2.1", "description": "The Simple oobabooga/text-generation-webui API Wrapper", "author": "PleahMaCaka", "license": "MIT", diff --git a/src/Client.ts b/src/Client.ts index 1b82ec4..36c4145 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -11,6 +11,8 @@ export class Client { constructor(options: ClientOptions) { this._uri = options.uri ? options.uri + "api/v1/" : "http://127.0.0.1:5000/api/v1/" + + if (!this._uri.endsWith("")) this._uri += "/" } async getCurrentModel(): Promise {