aboutsummaryrefslogtreecommitdiff
path: root/modules/ext
diff options
context:
space:
mode:
Diffstat (limited to 'modules/ext')
-rw-r--r--modules/ext/webdav.js8
1 files changed, 7 insertions, 1 deletions
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);