Skip to content

Commit

Permalink
Remove trailing paths from Jupyter URI (#13576)
Browse files Browse the repository at this point in the history
  • Loading branch information
DonJayamanne authored May 28, 2023
1 parent 479b682 commit 56efedd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/standalone/userJupyterServer/userServerUrlProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,9 @@ export class UserJupyterServerUrlProvider implements IExtensionSyncActivationSer
let promptingForServerName = false;
disposables.push(
input.onDidAccept(async () => {
const uri = input.value;

let uri = input.value.trim();
// If it ends with /lab? or /lab or /tree? or /tree, then remove that part.
uri = uri.replace(/\/(lab|tree)(\?|$)/, '');
try {
new URL(uri);
} catch (err) {
Expand Down

0 comments on commit 56efedd

Please sign in to comment.