From 32f875d6562ccdd21d3d94402e733371c755051f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCrg=C3=BCn=20Day=C4=B1o=C4=9Flu?= Date: Thu, 7 Sep 2023 11:56:08 +0200 Subject: [PATCH] lessen split-joins --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index ea42bb9..58721db 100644 --- a/index.js +++ b/index.js @@ -133,8 +133,8 @@ async function fastifyStatic (fastify, opts) { const roots = Array.isArray(sendOptions.root) ? sendOptions.root : [sendOptions.root] for (let i = 0; i < roots.length; ++i) { const rootPath = roots[i] - const files = await glob(path.join(rootPath, globPattern).split(path.win32.sep).join(path.posix.sep), { follow: true, nodir: true, dot: opts.serveDotFiles }) const posixRootPath = rootPath.split(path.win32.sep).join(path.posix.sep) + const files = await glob(path.posix.join(rootPath, globPattern), { follow: true, nodir: true, dot: opts.serveDotFiles }) for (let i = 0; i < files.length; ++i) { const file = files[i].split(path.win32.sep).join(path.posix.sep)