The loop in findFunctionFile started from parts.length - 1, which skipped the directory-level [[path]].js match when the request path had exactly one segment (e.g. /dav/, /file/). Changed to start from parts.length so these root paths correctly resolve to their handlers. Fixes /dav/ returning 404 and /file/ similarly affected.