@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.
- package/README.md +0 -1
- package/index.js +3 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|

|
|
4
4
|
[](https://www.npmjs.com/package/@fastify/static)
|
|
5
|
-
[](https://snyk.io/test/github/fastify/fastify-static)
|
|
6
5
|
[](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.
|
|
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": "^
|
|
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"
|