Skip to content

Commit

Permalink
Revert "remove win replacer"
Browse files Browse the repository at this point in the history
This reverts commit 5038801.
  • Loading branch information
gurgunday committed Sep 4, 2023
1 parent 5038801 commit 7de34e0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -340,8 +340,10 @@ async function fastifyStatic (fastify, opts) {
const indexDirs = new Map()
const routes = new Set()

const winSeparatorRegex = new RegExp(`\\${path.win32.sep}`, 'g')

for (const rootPath of Array.isArray(sendOptions.root) ? sendOptions.root : [sendOptions.root]) {
const files = await glob(path.join(rootPath, globPattern), { follow: true, nodir: true, dot: opts.serveDotFiles })
const files = await glob(path.join(rootPath, globPattern).replace(winSeparatorRegex, path.posix.sep), { follow: true, nodir: true, dot: opts.serveDotFiles })
const indexes = typeof opts.index === 'undefined' ? ['index.html'] : [].concat(opts.index)

for (let file of files) {
Expand Down

0 comments on commit 7de34e0

Please sign in to comment.