@fastify/static
Advanced tools
Comparing version 5.0.2 to 6.0.0
12
index.js
@@ -124,2 +124,3 @@ 'use strict' | ||
wrap.setHeader = reply.header.bind(reply) | ||
wrap.removeHeader = () => {} | ||
wrap.finished = false | ||
@@ -278,3 +279,3 @@ | ||
}, | ||
errorHandler: fastify.errorHandler ? errorHandler : undefined | ||
errorHandler | ||
} | ||
@@ -343,3 +344,3 @@ | ||
.replace(/^\//, '') | ||
const route = encodeURI(prefix + file).replace(/\/\//g, '/') | ||
const route = (prefix + file).replace(/\/\//g, '/') | ||
if (routes.has(route)) { | ||
@@ -455,2 +456,4 @@ continue | ||
function findIndexFile (pathname, root, indexFiles = ['index.html']) { | ||
// TODO remove istanbul ignore | ||
/* istanbul ignore else */ | ||
if (Array.isArray(indexFiles)) { | ||
@@ -467,2 +470,3 @@ return indexFiles.find(filename => { | ||
} | ||
/* istanbul ignore next */ | ||
return false | ||
@@ -515,4 +519,4 @@ } | ||
module.exports = fp(fastifyStatic, { | ||
fastify: '3.x', | ||
name: 'fastify-static' | ||
fastify: '4.x', | ||
name: '@fastify/static' | ||
}) |
{ | ||
"name": "@fastify/static", | ||
"version": "5.0.2", | ||
"version": "6.0.0", | ||
"description": "Plugin for serving static files as fast as possible.", | ||
@@ -10,7 +10,7 @@ "main": "index.js", | ||
"lint:fix": "standard --fix", | ||
"unit": "tap --no-check-coverage test/*.test.js", | ||
"unit": "tap test/*.test.js", | ||
"typescript": "tsd", | ||
"test": "npm run lint && npm run unit && npm run typescript", | ||
"example": "node example/server.js", | ||
"coverage": "tap --cov --coverage-report=html --no-check-coverage test", | ||
"coverage": "tap --cov --coverage-report=html test", | ||
"coveralls": "tap test/*test.js test/*/*.test.js --cov" | ||
@@ -39,6 +39,6 @@ }, | ||
"readable-stream": "^3.4.0", | ||
"send": "^0.17.1" | ||
"send": "^0.18.0" | ||
}, | ||
"devDependencies": { | ||
"@fastify/compress": "^5.0.0", | ||
"@fastify/compress": "^6.0.0", | ||
"@types/node": "^17.0.0", | ||
@@ -50,3 +50,3 @@ "@typescript-eslint/eslint-plugin": "^2.29.0", | ||
"eslint-plugin-typescript": "^0.14.0", | ||
"fastify": "^3.7.0", | ||
"fastify": "^4.0.0-rc.2", | ||
"handlebars": "^4.7.6", | ||
@@ -53,0 +53,0 @@ "pre-commit": "^1.2.2", |
@@ -22,3 +22,3 @@ 'use strict' | ||
t.teardown(fastify.close.bind(fastify)) | ||
fastify.listen(0, err => { | ||
fastify.listen({ port: 0 }, err => { | ||
t.error(err) | ||
@@ -106,3 +106,3 @@ fastify.server.unref() | ||
fastify.register(fastifyStatic, case_.options) | ||
fastify.listen(0, err => { | ||
fastify.listen({ port: 0 }, err => { | ||
t.equal(err.message, case_.error.message) | ||
@@ -109,0 +109,0 @@ fastify.server.unref() |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
1
355529
4508
+ Addeddepd@2.0.0(transitive)
+ Addeddestroy@1.2.0(transitive)
+ Addedhttp-errors@2.0.0(transitive)
+ Addedon-finished@2.4.1(transitive)
+ Addedsend@0.18.0(transitive)
+ Addedstatuses@2.0.1(transitive)
- Removeddepd@1.1.2(transitive)
- Removeddestroy@1.0.4(transitive)
- Removedhttp-errors@1.8.1(transitive)
- Removedon-finished@2.3.0(transitive)
- Removedsend@0.17.2(transitive)
- Removedstatuses@1.5.0(transitive)
Updatedsend@^0.18.0