diff options
| author | Agando <roduccomm@gmail.com> | 2026-10-21 22:34:12 +0200 |
|---|---|---|
| committer | Agando <roduccomm@gmail.com> | 2026-10-21 22:34:12 +0200 |
| commit | 586a3126c4cee9d9c6f4713568c693cb8002a77b (patch) | |
| tree | 359583902178b351f25e053bd16028a7aa935fe9 /modules/test | |
| parent | 7fdcab345f0905b49e7368a7908a3f507ee48b24 (diff) | |
fix(newos4): download link uses the user's space; WebDAV share copies verified file links; preview fullscreen+share; files->WebDAV upload button (v4.6.45)
- download: URL built from _resolveSpaceName() (config url = logged-in user), not the page space
- WebDAV browser 🔗: shares selected FILES only, URL-encoded, HEAD-verified (200) before claiming success;
folders offer a tar fallback instead of a guaranteed-403 link
- file manager preview: ⛶ fullscreen + 🔗 copy-link toolbar (was none)
- file manager toolbar: ☁ WebDAV publishes selected/current file via webdav-push
- modules/test/test-download-url.js: 4 PASS
- rebuild bundles, bump v4.6.44 -> v4.6.45 (loader + 3 script tags)
Diffstat (limited to 'modules/test')
| -rw-r--r-- | modules/test/test-download-url.js | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/modules/test/test-download-url.js b/modules/test/test-download-url.js new file mode 100644 index 0000000..63cabde --- /dev/null +++ b/modules/test/test-download-url.js @@ -0,0 +1,32 @@ +// node modules/test/test-download-url.js +// Regression guard for the download/share URL space (2026-10-21). +// The URL must follow the WebDAV config (the logged-in user's space), NOT the +// page path — /spaces/newos4/ is the app, not the user. +const cases = [ + { page: '/spaces/newos4/', cfg: 'https://webx11.duckdns.org/spaces/agando/', want: 'agando' }, + { page: '/spaces/newos4/', cfg: 'https://webx11.duckdns.org/spaces/mindtech/', want: 'mindtech' }, + { page: '/spaces/agando/', cfg: 'https://webx11.duckdns.org/spaces/agando/', want: 'agando' }, + { page: '/spaces/newos4/', cfg: '', want: 'newos4' }, // no config → fall back to the page space +]; + +function detectSpaceName(path) { + const parts = path.split('/').filter(Boolean); + const i = parts.indexOf('spaces'); + return (i >= 0 && i + 1 < parts.length) ? parts[i + 1] : ''; +} +function extractSpaceNameFromUrl(url) { + if (!url) return ''; + const parts = new URL(url).pathname.split('/').filter(Boolean); + const i = parts.indexOf('spaces'); + return (i >= 0 && i + 1 < parts.length) ? parts[i + 1] : ''; +} + +let bad = 0; +for (const c of cases) { + const got = extractSpaceNameFromUrl(c.cfg) || detectSpaceName(c.page); + const ok = got === c.want; + if (!ok) bad++; + console.log((ok ? 'PASS' : 'FAIL'), c.page, 'cfg=' + (c.cfg || '(none)'), '→', got, '(want', c.want + ')'); +} +console.log(bad ? `\n${bad} FAILED` : `\n${cases.length} PASS`); +process.exit(bad ? 1 : 0); |