Socket
Socket
Sign inDemoInstall

@fastify/static

Package Overview
Dependencies
Maintainers
17
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 5.0.1 to 5.0.2

test/static-symbolic-link/origin/subdir/subdir/index.html

4

index.d.ts

@@ -61,3 +61,3 @@ // Definitions by: Jannik <https://github.com/jannikkeye>

immutable?: boolean;
index?: string[] | false;
index?: string[] | string | false;
lastModified?: boolean;

@@ -92,3 +92,3 @@ maxAge?: string | number;

immutable?: boolean;
index?: string[] | false;
index?: string[] | string | false;
lastModified?: boolean;

@@ -95,0 +95,0 @@ maxAge?: string | number;

@@ -329,3 +329,3 @@ 'use strict'

} else {
const globPattern = '**/*'
const globPattern = '**/**'
const indexDirs = new Map()

@@ -453,11 +453,14 @@ const routes = new Set()

function findIndexFile (pathname, root, indexFiles = ['index.html']) {
return indexFiles.find(filename => {
const p = path.join(root, pathname, filename)
try {
const stats = statSync(p)
return !stats.isDirectory()
} catch (e) {
return false
}
})
if (Array.isArray(indexFiles)) {
return indexFiles.find(filename => {
const p = path.join(root, pathname, filename)
try {
const stats = statSync(p)
return !stats.isDirectory()
} catch (e) {
return false
}
})
}
return false
}

@@ -464,0 +467,0 @@

{
"name": "@fastify/static",
"version": "5.0.1",
"version": "5.0.2",
"description": "Plugin for serving static files as fast as possible.",

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

@@ -162,3 +162,3 @@ # @fastify/static

If set to `false`, `@fastify/static` globs the filesystem for all defined
files in the served folder (`${root}/**/*`), and just creates the routes needed for
files in the served folder (`${root}/**/**`), and just creates the routes needed for
those and it will not serve the newly added file on the filesystem.

@@ -165,0 +165,0 @@

@@ -31,3 +31,4 @@ import fastify from 'fastify'

expectError<FastifyStaticOptions>({
wlidcard: '**/*'
root: '',
wildcard: '**/**'
})

@@ -107,1 +108,12 @@

})
const defaultIndexApp = fastify()
options.index = 'index.html'
defaultIndexApp
.register(fastifyStatic, options)
.after(() => {
defaultIndexApp.get('/', (request, reply) => {
reply.send('<h1>fastify-static</h1>')
})
})

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

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