@fastify/static
Advanced tools
Comparing version 6.7.0 to 6.8.0
17
index.js
@@ -30,2 +30,6 @@ 'use strict' | ||
if (opts.dotfiles === undefined) { | ||
opts.dotfiles = 'allow' | ||
} | ||
const sendOptions = { | ||
@@ -41,4 +45,3 @@ root: opts.root, | ||
lastModified: opts.lastModified, | ||
maxAge: opts.maxAge, | ||
serveDotFiles: opts.serveDotFiles ?? false | ||
maxAge: opts.maxAge | ||
} | ||
@@ -342,3 +345,3 @@ | ||
for (const rootPath of Array.isArray(sendOptions.root) ? sendOptions.root : [sendOptions.root]) { | ||
const files = await globPromise(path.join(rootPath, globPattern).replace(winSeparatorRegex, path.posix.sep), { nodir: true, dot: sendOptions.serveDotFiles }) | ||
const files = await globPromise(path.join(rootPath, globPattern).replace(winSeparatorRegex, path.posix.sep), { nodir: true, dot: opts.serveDotFiles }) | ||
const indexes = typeof opts.index === 'undefined' ? ['index.html'] : [].concat(opts.index) | ||
@@ -453,8 +456,8 @@ | ||
function getContentType (path) { | ||
const type = send.mime.lookup(path) | ||
const charset = send.mime.charsets.lookup(type) | ||
if (!charset) { | ||
const type = send.mime.getType(path) | ||
if (!send.isUtf8MimeType(type)) { | ||
return type | ||
} | ||
return `${type}; charset=${charset}` | ||
return `${type}; charset=UTF-8` | ||
} | ||
@@ -461,0 +464,0 @@ |
{ | ||
"name": "@fastify/static", | ||
"version": "6.7.0", | ||
"version": "6.8.0", | ||
"description": "Plugin for serving static files as fast as possible.", | ||
@@ -38,3 +38,3 @@ "main": "index.js", | ||
"readable-stream": "^4.0.0", | ||
"@fastify/send": "^1.0.0" | ||
"@fastify/send": "^2.0.0" | ||
}, | ||
@@ -41,0 +41,0 @@ "devDependencies": { |
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
4889
358038
+ Added@fastify/send@2.1.0(transitive)
+ Added@lukeed/ms@2.0.2(transitive)
+ Addedfast-decode-uri-component@1.0.1(transitive)
+ Addedmime@3.0.0(transitive)
- Removed@fastify/send@1.0.0(transitive)
- Removeddebug@4.3.7(transitive)
- Removeddestroy@1.2.0(transitive)
- Removedee-first@1.1.1(transitive)
- Removedencodeurl@1.0.2(transitive)
- Removedetag@1.8.1(transitive)
- Removedfresh@0.5.2(transitive)
- Removedmime@1.6.0(transitive)
- Removedms@2.1.3(transitive)
- Removedon-finished@2.4.1(transitive)
- Removedrange-parser@1.2.1(transitive)
Updated@fastify/send@^2.0.0