Socket
Socket
Sign inDemoInstall

@fastify/static

Package Overview
Dependencies
Maintainers
19
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fastify/static - npm Package Compare versions

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": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc