mirror of
https://github.com/Donkie/Spoolman.git
synced 2026-10-22 10:02:17 -05:00
SvelteKit's adapter-static emits the SPA fallback (200.html) with absolute asset paths (/_app/...) and a hardcoded base: "", since it can't know the deploy base path at build time. Prerendered per-route documents use relative paths and a runtime-computed base, so they work under any base path, but the fallback is used for non-prerendered dynamic routes (/spool/show/<id>, /filament/show/<id>) -- exactly the URLs printed into QR labels. Under a base path those direct loads 404'd every asset and rendered a blank page. Rewrite the fallback server-side using the base path the backend already knows, mirroring the legacy-client asset rewrite: prefix /_app/ and /favicon references and set the runtime base. Prerendered docs are still served verbatim, and the legacy client is unaffected (its tweaked_html is always produced when rewrite_asset_paths is on, so the file_response guard change is equivalent there).