Skip to content

Commit

Permalink
remove win replacer
Browse files Browse the repository at this point in the history
  • Loading branch information
gurgunday committed Sep 4, 2023
1 parent 5bec871 commit 5038801
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -340,10 +340,8 @@ 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).replace(winSeparatorRegex, path.posix.sep), { follow: true, nodir: true, dot: opts.serveDotFiles })
const files = await glob(path.join(rootPath, globPattern), { 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 5038801

Please sign in to comment.