Skip to content

Commit

Permalink
check for trace server URL ending with slash
Browse files Browse the repository at this point in the history
Fixes #37

With this commit, the trace server extension will check if the base
trace server URL, defined as a preference, ends with a slash. If
that's the case, it will be used to compose the TSP endpoint URL,
if not it will be added.

Signed-off-by: Marc Dumais <[email protected]>
  • Loading branch information
marcdumais-work committed Aug 23, 2024
1 parent 8aca35b commit 3e76706
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/trace-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,8 @@ export class TraceServer {

private getServerUrl() {
const from = this.getClientSettings();
return this.getUrl(from) + '/' + this.getApiPath(from);
const baseUrl = this.getUrl(from);
return baseUrl.endsWith('/') ? baseUrl + this.getApiPath(from) : baseUrl + '/' + this.getApiPath(from);
}

private async waitFor(context: vscode.ExtensionContext | undefined) {
Expand Down

0 comments on commit 3e76706

Please sign in to comment.