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 | 82de48abbac8ae50f3c3859a4118a606145fc55a (patch) | |
| tree | 337ce881bc629ed9b84527655a0392cc4ec00876 /modules/core/core-bundle.js | |
| parent | 623717700ee9677e82ba29eab7170b1b25a16068 (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/core/core-bundle.js')
| -rw-r--r-- | modules/core/core-bundle.js | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/modules/core/core-bundle.js b/modules/core/core-bundle.js index ee2e9d0..3f7e352 100644 --- a/modules/core/core-bundle.js +++ b/modules/core/core-bundle.js @@ -6716,7 +6716,15 @@ class FileSystemModule { const baseUrl = wdav.config.url.replace(/\/+$/, ''); const hostMatch = baseUrl.match(/^(https?:\/\/[^\/]+)/); const host = hostMatch ? hostMatch[1] : 'https://webx11.duckdns.org'; - downloadUrl = host + '/spaces/' + wdav._spaceName + '/downloads/' + encodeURIComponent(fname); + // Build the public URL the user can tap. + // The URL must use the space the PUT actually went to + // (config.url = the logged-in user's space). _spaceName is + // derived from the page path (/spaces/newos4/…) and is wrong + // for users downloading into their own space (2026-10-21). + const urlSpace = (typeof wdav._resolveSpaceName === 'function' && wdav._resolveSpaceName()) || + (wdav._extractSpaceNameFromUrl && wdav._extractSpaceNameFromUrl(wdav.config.url)) || + wdav._spaceName; + downloadUrl = host + '/spaces/' + urlSpace + '/downloads/' + encodeURIComponent(fname); this.terminal.print('Uploaded to: ' + downloadUrl, 'success'); } else { this.terminal.print('WebDAV push failed: HTTP ' + resp.status, 'warning'); |