diff options
| author | Agando <roduccomm@gmail.com> | 2026-10-15 05:00:13 +0200 |
|---|---|---|
| committer | Agando <roduccomm@gmail.com> | 2026-10-15 05:00:13 +0200 |
| commit | c3f89abb448021ecf894b27692dba0a7dc2ff8e3 (patch) | |
| tree | ecbf0d800313f577c47607bcbb234ed5121ecf64 /modules/ext | |
| parent | 7deb5e35160c001b29c890cbb1a74e6c65a6e0ba (diff) | |
auto: 2026-07-29_20:45 changes
Diffstat (limited to 'modules/ext')
| -rw-r--r-- | modules/ext/webdav.js | 8 |
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); |