From fbf3780464cd0fb1a186a30721e2425e0a7484b0 Mon Sep 17 00:00:00 2001 From: stevejpurves Date: Tue, 28 Nov 2023 12:11:37 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=BD=20ensure=20no=20double=20forward?= =?UTF-8?q?=20slashes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/jupyter/src/hooks.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/jupyter/src/hooks.ts b/packages/jupyter/src/hooks.ts index c67c16ba9..d91b9671c 100644 --- a/packages/jupyter/src/hooks.ts +++ b/packages/jupyter/src/hooks.ts @@ -168,8 +168,7 @@ export function useLaunchBinder() { if (userServerUrl && location) { // add the location to the url pathname const url = new URL(userServerUrl); - if (url.pathname.endsWith('/')) url.pathname = url.pathname.slice(0, -1); - url.pathname = `${url.pathname}/lab/tree${location}`; + url.pathname = `${url.pathname}lab/tree${location}`.replace(/\/+/g, '/'); userServerUrl = url.toString(); } return userServerUrl;