mirror of
https://github.com/TabbyML/tabby
synced 2024-11-22 00:08:06 +00:00
fix(agent): fix the endpoint config to always remove trailing slash. (#2472)
* fix(agent): fix the endpoint config to always remove trailing slash. * fix(agent): fix lint.
This commit is contained in:
parent
64a4df227a
commit
4855d23660
3
clients/tabby-agent/src/TabbyAgent.ts
vendored
3
clients/tabby-agent/src/TabbyAgent.ts
vendored
@ -96,6 +96,7 @@ export class TabbyAgent extends EventEmitter implements Agent {
|
||||
this.clientConfig,
|
||||
this.serverProvidedConfig,
|
||||
) as AgentConfig;
|
||||
this.config.server.endpoint = this.config.server.endpoint.replace(/\/+$/, ""); // remove trailing slash
|
||||
this.logger.trace("Updated config:", this.config);
|
||||
|
||||
if (fileLogger) {
|
||||
@ -153,7 +154,7 @@ export class TabbyAgent extends EventEmitter implements Agent {
|
||||
? `Bearer ${this.auth.token}`
|
||||
: undefined;
|
||||
this.api = createClient<TabbyApi>({
|
||||
baseUrl: this.config.server.endpoint.replace(/\/+$/, ""), // remove trailing slash
|
||||
baseUrl: this.config.server.endpoint,
|
||||
headers: {
|
||||
Authorization: auth,
|
||||
...this.config.server.requestHeaders,
|
||||
|
Loading…
Reference in New Issue
Block a user