The prefix fix routed every route through `__DSH_TRANSPORT__.streamBaseUrl`.
For WebSockets that base is required (a custom scheme cannot host `ws:`, and
the shell page's host is the literal `app`, whose DNS lookup never completes),
but for HTTP it is a DIFFERENT origin than the page: the Electron shell serves
the GUI from `dsh-app://app/` while `streamBaseUrl` is the Host's
`http://127.0.0.1:<port>` (`streamBaseUrl: new URL(hostUrl).origin` in the
shell's `main.js`, via `DESKTOP_IPC.boot`).
Measured on DSH 0.2.0-rc.2 + Electron shell:
- `OPTIONS /sidebar/api/fs.trees` (Origin: dsh-app://app, preflight for the
plugin's JSON POSTs) → `405 method not allowed`, no `Access-Control-Allow-*`
header; the actual POST answers `400` with no CORS header either.
- The shell's `protocol.handle('dsh-app', …)` forwards every NON-STATIC
`dsh-app://app` path to the Host (`forwardWebRequest(request, hostUrl,
hostCookie)`), so `dsh-app://app/sidebar/api/…` reaches the Host same-origin —
the exact shape `fetch('/sidebar/api/…')` produced before the prefix fix.
Consequence in the desktop window: every plugin request is blocked by the
browser and surfaces as "Failed to fetch" — file tree (the whole sidebar body),
git, editor, uploads, archive, chunk loading. The web profile in a browser is
unaffected (there the page origin IS the transport origin), which is why the
mount lane cannot see it.
HTTP now resolves against `document.baseURI` — which carries a reverse-proxy
directory prefix too, so one rule covers both deployments — and falls back to
the transport base when no page base exists (specs / SSR). WebSockets keep the
transport base. `tests/base-path.spec.ts` pins the split per transport,
including the shell case and the no-page-base fallback.