Socket
Socket
Sign inDemoInstall

@fastify/static

Package Overview
Dependencies
34
Maintainers
19
Versions
29
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 6.10.0 to 6.10.1

25

index.js
'use strict'
const path = require('path')
const url = require('url')
const statSync = require('fs').statSync

@@ -17,2 +18,3 @@ const { PassThrough } = require('readable-stream')

async function fastifyStatic (fastify, opts) {
opts.root = normalizeRoot(opts.root)
checkRootPathForErrors(fastify, opts.root)

@@ -398,2 +400,25 @@

}
function normalizeRoot (root) {
if (root === undefined) {
return root
}
if (root instanceof URL && root.protocol === 'file:') {
return url.fileURLToPath(root)
}
if (Array.isArray(root)) {
const result = []
for (let i = 0, il = root.length; i < il; ++i) {
if (root[i] instanceof URL && root[i].protocol === 'file:') {
result.push(url.fileURLToPath(root[i]))
} else {
result.push(root[i])
}
}
return result
}
return root
}
function checkRootPathForErrors (fastify, rootPath) {

@@ -400,0 +425,0 @@ if (rootPath === undefined) {

2

package.json
{
"name": "@fastify/static",
"version": "6.10.0",
"version": "6.10.1",
"description": "Plugin for serving static files as fast as possible.",

@@ -5,0 +5,0 @@ "main": "index.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc