From c3f89abb448021ecf894b27692dba0a7dc2ff8e3 Mon Sep 17 00:00:00 2001 From: Agando Date: Thu, 15 Oct 2026 05:00:13 +0200 Subject: auto: 2026-07-29_20:45 changes --- modules/ext/webdav.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'modules/ext/webdav.js') diff --git a/modules/ext/webdav.js b/modules/ext/webdav.js index 5cacea0..310d6f3 100644 --- a/modules/ext/webdav.js +++ b/modules/ext/webdav.js @@ -424,7 +424,13 @@ class WebDAVModule { // Avoid double slash when path starts with / const listUrl = host + '/spaces/' + spaceName + '/__list__' + (cleanPath === '/' ? '' : cleanPath.replace(/\/{2,}/g, '/')); try { - const resp = await fetch(listUrl, { method: 'GET' }); + // 2026-10-11: __list__ is owner-gated — send the space token when we + // have one; if it is stale (401/403), retry cookie-only before failing. + const authHeaders = this._getAuthHeader(); + let resp = await fetch(listUrl, { method: 'GET', headers: authHeaders }); + if ((resp.status === 401 || resp.status === 403) && Object.keys(authHeaders).length) { + resp = await fetch(listUrl, { method: 'GET' }); + } if (!resp.ok) throw new Error('Autoindex failed: HTTP ' + resp.status); const html = await resp.text(); return this._parseAutoindex(html); -- cgit v1.2.3