webdav: filezilla-pro compatibility

Massimo Melina committed Mar 9, 2026 at 00:42 UTC 73e6a13bac5c44895903492e3bba00aa4e2fc172
1 file changed +3 -1
src/webdav.ts
+3 -1
@@ -55,7 +55,9 @@ function hasToken(header: string, token: string) {
55 }
56
57 export async function handledWebdav(ctx: Koa.Context) {
58 - const {path} = ctx
58 + let {path} = ctx
59 + path = path.replace(/^\/+/, '/') // double-slash is causing empty listing in filezilla pro
60 +
61 const isWebdavAuthRequest = WEBDAV_METHODS.has(ctx.method) || WEBDAV_HINT_HEADERS.some(h => !!ctx.get(h))
62 const ua = ctx.get('user-agent')
63 if (isWebdavAuthRequest && getCurrentUsername(ctx)) {