diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b4faa20..e0464e51 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,12 @@ ## [Unreleased] +## [v0.51.508] — 2026-06-19 — Release RS (the /model command works under a reverse-proxy subpath) + +### Fixed + +- **The `/model` slash command now works when the WebUI is served under a subpath (#3368 follow-up).** Its two API calls (`/api/models` and `/api/session/update`) used root-absolute paths that broke behind a reverse proxy mounting the app under a subpath; they now resolve relative to `document.baseURI`, matching how the rest of the app builds API URLs. Thanks @tomtong2015. + ## [v0.51.507] — 2026-06-19 — Release RR (jump-to-question button stays usable on mobile) ### Fixed diff --git a/static/commands.js b/static/commands.js index 2cd0c6ad..ec7daaf7 100644 --- a/static/commands.js +++ b/static/commands.js @@ -547,7 +547,7 @@ async function cmdModel(args){ // CLI resolves against the full catalog, so /model must too. (#3368) let modelsData=null; try { - const resp=await fetch('/api/models'); + const resp=await fetch(new URL('api/models',document.baseURI||location.href).href); if(resp.ok){ modelsData=await resp.json(); const aliases=modelsData.aliases||{}; @@ -587,7 +587,7 @@ async function cmdModel(args){ if(!match && !versionedNoSnap && S&&S.session&&S.session.session_id){ const provider=q.slice(0,q.indexOf('/')); try{ - const resp=await fetch('/api/session/update',{ + const resp=await fetch(new URL('api/session/update',document.baseURI||location.href).href,{ method:'POST', headers:{'Content-Type':'application/json'}, body:JSON.stringify({