From e63ec9aedc484e04d7deb695f2f1ba3e24f5c65e Mon Sep 17 00:00:00 2001 From: Simon Li Date: Tue, 13 Aug 2024 16:33:16 +0100 Subject: [PATCH] Admin pages: use inherited base_url from render_template --- jsx/src/util/jhapiUtil.js | 2 +- jupyterhub/handlers/pages.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/jsx/src/util/jhapiUtil.js b/jsx/src/util/jhapiUtil.js index 5616b036..625909ee 100644 --- a/jsx/src/util/jhapiUtil.js +++ b/jsx/src/util/jhapiUtil.js @@ -3,7 +3,7 @@ const base_url = jhdata.base_url || "/"; const xsrfToken = jhdata.xsrf_token; export const jhapiRequest = (endpoint, method, data) => { - let api_url = new URL(`${base_url}hub/api` + endpoint, location.origin); + let api_url = new URL(`${base_url}api` + endpoint, location.origin); if (xsrfToken) { api_url.searchParams.set("_xsrf", xsrfToken); } diff --git a/jupyterhub/handlers/pages.py b/jupyterhub/handlers/pages.py index a1ad4a83..0b9b2cf2 100644 --- a/jupyterhub/handlers/pages.py +++ b/jupyterhub/handlers/pages.py @@ -466,7 +466,6 @@ class AdminHandler(BaseHandler): named_server_limit_per_user=await self.get_current_user_named_server_limit(), server_version=f'{__version__} {self.version_hash}', api_page_limit=self.settings["api_page_default_limit"], - base_url=self.settings["base_url"], ) self.finish(html)