From e9d7d5e42780280a317ad06d3f29fed67f8c362d Mon Sep 17 00:00:00 2001 From: Michael Lam Date: Sun, 3 May 2026 23:57:52 -0700 Subject: [PATCH] fix: keep frontend routes under subpath mounts --- api/auth.py | 2 +- static/boot.js | 2 +- static/index.html | 2 +- static/messages.js | 6 +-- static/sessions.js | 2 +- static/ui.js | 10 ++-- static/workspace.js | 6 +-- tests/test_1038_pwa_auth_redirect.py | 16 +++--- tests/test_approval_sse.py | 8 +-- tests/test_clarify_sse.py | 3 +- tests/test_extension_hooks.py | 2 +- tests/test_issue1118_idle_session_retry.py | 8 +-- tests/test_subpath_frontend_routes.py | 61 ++++++++++++++++++++++ tests/test_update_banner_fixes.py | 7 +-- tests/test_v050258_opus_followups.py | 6 +-- 15 files changed, 105 insertions(+), 36 deletions(-) create mode 100644 tests/test_subpath_frontend_routes.py diff --git a/api/auth.py b/api/auth.py index fa1e04cc..0927e5f7 100644 --- a/api/auth.py +++ b/api/auth.py @@ -256,7 +256,7 @@ def check_auth(handler, parsed) -> bool: # safe='/' keeps path separators readable; everything else (including # `?`, `&`, `=`) gets percent-encoded. _next = _urlparse.quote(_path_with_query, safe='/') - handler.send_header('Location', '/login?next=' + _next) + handler.send_header('Location', 'login?next=' + _next) handler.end_headers() return False diff --git a/static/boot.js b/static/boot.js index a54f75a5..db595679 100644 --- a/static/boot.js +++ b/static/boot.js @@ -1287,7 +1287,7 @@ function applyBotName(){ // ?test_updates=1 in URL forces banner display for testing (bypasses sessionStorage guards) const _testUpdates=new URLSearchParams(location.search).get('test_updates')==='1'; if(_testUpdates||(_bootSettings.check_for_updates!==false&&!sessionStorage.getItem('hermes-update-checked')&&!sessionStorage.getItem('hermes-update-dismissed'))){ - const _checkUrl='/api/updates/check'+(_testUpdates?'?simulate=1':''); + const _checkUrl='api/updates/check'+(_testUpdates?'?simulate=1':''); api(_checkUrl).then(d=>{if(!_testUpdates)sessionStorage.setItem('hermes-update-checked','1');if((d.webui&&d.webui.behind>0)||(d.agent&&d.agent.behind>0))_showUpdateBanner(d);}).catch(()=>{}); } // Fetch active profile diff --git a/static/index.html b/static/index.html index 2d22a9f1..025c95be 100644 --- a/static/index.html +++ b/static/index.html @@ -28,7 +28,7 @@