diff options
Diffstat (limited to 'scripts/test-webdav-paths.mjs')
| -rw-r--r-- | scripts/test-webdav-paths.mjs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/scripts/test-webdav-paths.mjs b/scripts/test-webdav-paths.mjs index a8340c0..d75f9f6 100644 --- a/scripts/test-webdav-paths.mjs +++ b/scripts/test-webdav-paths.mjs @@ -57,7 +57,7 @@ function check(name, cond, got) { // relative + traversal + dupes: ['./a//b/../c.txt', '/a/c.txt'], ['/a/b/../../d.txt', '/d.txt'], - ['/skills/', '/skills'], + ['/skills/', '/skills/'], // trailing slash PRESERVED (nginx dav collection ops need it) ['backups', '/backups'], // foreign space stays intact (only own space prefix is stripped): ['/spaces/otheruser/file.txt', '/spaces/otheruser/file.txt'], @@ -90,8 +90,8 @@ function check(name, cond, got) { }; m._listDir = async () => { throw new Error('ENOENT'); }; await m._ensureDir('https://webx11.duckdns.org/spaces/mindtech/thaimassage-kiefersfelden'); - check('_ensureDir MKCOLs normalized path (no https:/ junk)', - mkcols.length === 1 && mkcols[0] === '/thaimassage-kiefersfelden', mkcols); + check('_ensureDir MKCOLs normalized path (no https:/ junk, trailing slash for nginx)', + mkcols.length === 1 && mkcols[0] === '/thaimassage-kiefersfelden/', mkcols); // Existing dir fast-path: __list__ probe succeeds -> no MKCOL at all const m2 = makeMod(); @@ -107,7 +107,8 @@ function check(name, cond, got) { m3._listDir = async (p) => { if (p === '/backups') return []; throw new Error('ENOENT'); }; m3._webdavRequest = async (method, path) => { if (method === 'MKCOL') mkcols3.push(path); return { ok: true, status: 201 }; }; await m3._ensureDir('/backups/2026'); - check('_ensureDir MKCOLs only missing tail', mkcols3.length === 1 && mkcols3[0] === '/backups/2026', mkcols3); + check('_ensureDir MKCOLs only missing tail (trailing slash for nginx)', + mkcols3.length === 1 && mkcols3[0] === '/backups/2026/', mkcols3); } // --- PUT via _webdavRequest hits normalized URL --- |