fix: wrong "method not allowed" in case of UNC folders #1222
Massimo Melina committed
Apr 24, 2026 at 14:24 UTC
4fb1280dd55eb48cc7c284726b0967ce2edac4f5
1 file changed
+4
-3
src/vfs.ts
+4
-3
@@ -181,12 +181,13 @@ export async function getNodeByName(name: string, parent: VfsNode, assumeMissing
181
}
182
}
183
184
-const smartUncFolderDetection = defineConfig('smart_unc_folder_detection', true)
184
+const smartUncFolderDetection = defineConfig('smart_unc_folder_detection', false)
185
186
async function setIsFolder(node: VfsNode) {
187
if (!node.source) return
188
- const isFolder = smartUncFolderDetection.get() && getUncHost(node.source) ? !basename(node.source).includes('.') // no dot = folder – not very reliable but fast for unreachable unc hosts, and you can opt-out
189
- : /[\\/]$/.test(node.source) || await nodeStats(node).then(x => x?.isDirectory(), () => undefined)
188
+ const isFolder = /[\\/]$/.test(node.source)
189
+ || smartUncFolderDetection.get() && getUncHost(node.source) && !basename(node.source).includes('.') // no dot = folder; not very reliable but fast for unreachable unc hosts, and it's an opt-in
190
+ || await nodeStats(node).then(x => x?.isDirectory(), () => undefined)
191
setHidden(node, { isFolder })
192
return isFolder
193
}