From ebe3998a511d4758ed7ff11395f8771d4ad94f8f Mon Sep 17 00:00:00 2001 From: YuviPanda Date: Fri, 23 Apr 2021 21:07:39 +0530 Subject: [PATCH] Handle lack of trailing slashes in hub URLs Without this, if your hub url was something like https://myhub.com/jupyter, your nbgitpuller URL will be something like https://myhub.com/jupyterhub/user-redirect... instead of https://myhub.com/jupyter/hub/user-redirect... --- docs/_static/link_gen/link.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/_static/link_gen/link.js b/docs/_static/link_gen/link.js index de93b2e8..5367b713 100644 --- a/docs/_static/link_gen/link.js +++ b/docs/_static/link_gen/link.js @@ -14,6 +14,9 @@ function generateRegularUrl(hubUrl, urlPath, repoUrl, branch) { url.searchParams.set('branch', branch); } + if (!url.pathname.endsWith('/')) { + url.pathname += '/' + } url.pathname += 'hub/user-redirect/git-pull'; return url.toString();