@fastify/static 6.0.0 → 6.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +0 -1
  2. package/index.js +3 -1
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -2,7 +2,6 @@
2
2
 
3
3
  ![CI](https://github.com/fastify/fastify-static/workflows/CI/badge.svg)
4
4
  [![NPM version](https://img.shields.io/npm/v/@fastify/static.svg?style=flat)](https://www.npmjs.com/package/@fastify/static)
5
- [![Known Vulnerabilities](https://snyk.io/test/github/fastify/fastify-static/badge.svg)](https://snyk.io/test/github/fastify/fastify-static)
6
5
  [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://standardjs.com/)
7
6
 
8
7
  Plugin for serving static files as fast as possible. Supports Fastify version `3.x`.
package/index.js CHANGED
@@ -331,8 +331,10 @@ async function fastifyStatic (fastify, opts) {
331
331
  const indexDirs = new Map()
332
332
  const routes = new Set()
333
333
 
334
+ const winSeparatorRegex = new RegExp(`\\${path.win32.sep}`, 'g')
335
+
334
336
  for (const rootPath of Array.isArray(sendOptions.root) ? sendOptions.root : [sendOptions.root]) {
335
- const files = await globPromise(path.join(rootPath, globPattern), { nodir: true })
337
+ const files = await globPromise(path.join(rootPath, globPattern).replace(winSeparatorRegex, path.posix.sep), { nodir: true })
336
338
  const indexes = typeof opts.index === 'undefined' ? ['index.html'] : [].concat(opts.index)
337
339
 
338
340
  for (let file of files) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fastify/static",
3
- "version": "6.0.0",
3
+ "version": "6.1.0",
4
4
  "description": "Plugin for serving static files as fast as possible.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -32,7 +32,7 @@
32
32
  "content-disposition": "^0.5.3",
33
33
  "encoding-negotiator": "^2.0.1",
34
34
  "fastify-plugin": "^3.0.0",
35
- "glob": "^7.1.4",
35
+ "glob": "^8.0.1",
36
36
  "p-limit": "^3.1.0",
37
37
  "readable-stream": "^3.4.0",
38
38
  "send": "^0.18.0"