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/core-bundle.js | 10 +++++++++- modules/core/module-fs.js | 10 +++++++++- modules/core/module-loader.js | 2 +- 3 files changed, 19 insertions(+), 3 deletions(-) (limited to 'modules/core') 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'); 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'); diff --git a/modules/core/module-loader.js b/modules/core/module-loader.js index 7416e02..3aedc0d 100644 --- a/modules/core/module-loader.js +++ b/modules/core/module-loader.js @@ -4,7 +4,7 @@ // Core module bundle loaded synchronously in main.html. // This loader only handles version cache-busting, splash, terminal init, and optional ext modules. - const LATEST_VER = 'v4.6.44'; + const LATEST_VER = 'v4.6.45'; const CACHE = '?v=' + LATEST_VER; const stored = localStorage.getItem('webx11_cache_ver'); if (stored !== LATEST_VER) { -- cgit v1.2.3