From 586a3126c4cee9d9c6f4713568c693cb8002a77b Mon Sep 17 00:00:00 2001 From: Agando Date: Wed, 21 Oct 2026 22:34:12 +0200 Subject: 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) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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) --- modules/core/module-fs.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'modules/core/module-fs.js') diff --git a/modules/core/module-fs.js b/modules/core/module-fs.js index d94feb8..2b525f0 100644 --- a/modules/core/module-fs.js +++ b/modules/core/module-fs.js @@ -447,7 +447,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'); -- cgit v1.2.3