Skip to content

Commit

Permalink
fix(agent): fix errors when endpoint config ends with trailing slash. (
Browse files Browse the repository at this point in the history
…#3281)

* fix(agent): fix errors when endpoint config ends with trailing slash.

* [autofix.ci] apply automated fixes

* fix(agent): remove possible multiple trailing slashes from the endpoint config.

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
  • Loading branch information
icycodes and autofix-ci[bot] committed Oct 17, 2024
1 parent 9d9c1e2 commit 06a2b16
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions clients/tabby-agent/src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ function mergeConfig(
serverProvidedConfig.anonymousUsageTracking = { disable: true };
}
const merged = mergeFunction(base, configFileConfig, clientProvidedConfig, serverProvidedConfig) as ConfigData;

// remove trailing slash from endpoint
if (merged.server.endpoint) {
merged.server.endpoint = merged.server.endpoint.replace(/\/+$/, "");
}

return merged;
}

Expand Down

0 comments on commit 06a2b16

Please sign in to comment.