fastify-static
Advanced tools
Comparing version 3.3.0 to 3.3.1
'use strict' | ||
window.onload = function () { | ||
var b = document.getElementById('my-button') | ||
const b = document.getElementById('my-button') | ||
b.onclick = function () { | ||
@@ -6,0 +6,0 @@ window.alert('foo') |
@@ -48,3 +48,3 @@ // Definitions by: Jannik <https://github.com/jannikkeye> | ||
cacheControl?: boolean; | ||
dotfiles?: boolean; | ||
dotfiles?: 'allow' | 'deny' | 'ignore'; | ||
etag?: boolean; | ||
@@ -51,0 +51,0 @@ extensions?: string[]; |
@@ -42,3 +42,3 @@ 'use strict' | ||
function pumpSendToReply (request, reply, pathname, rootPath) { | ||
var options = Object.assign({}, sendOptions) | ||
const options = Object.assign({}, sendOptions) | ||
@@ -50,3 +50,3 @@ if (rootPath) { | ||
const stream = send(request.raw, pathname, options) | ||
var resolvedFilename | ||
let resolvedFilename | ||
stream.on('file', function (file) { | ||
@@ -176,3 +176,3 @@ resolvedFilename = file | ||
file = file.replace(sendOptions.root.replace(/\\/g, '/'), '').replace(/^\//, '') | ||
const route = (prefix + file).replace(/\/\//g, '/') | ||
const route = encodeURI(prefix + file).replace(/\/\//g, '/') | ||
fastify.get(route, routeOpts, function (req, reply) { | ||
@@ -222,3 +222,3 @@ pumpSendToReply(req, reply, '/' + file) | ||
var pathStat | ||
let pathStat | ||
@@ -225,0 +225,0 @@ try { |
{ | ||
"name": "fastify-static", | ||
"version": "3.3.0", | ||
"version": "3.3.1", | ||
"description": "Plugin for serving static files as fast as possible.", | ||
@@ -9,2 +9,3 @@ "main": "index.js", | ||
"lint": "standard | snazzy", | ||
"lint:fix": "standard --fix", | ||
"unit": "tap test/*.test.js", | ||
@@ -50,6 +51,6 @@ "typescript": "tsd", | ||
"simple-get": "^4.0.0", | ||
"snazzy": "^8.0.0", | ||
"standard": "^14.0.0", | ||
"snazzy": "^9.0.0", | ||
"standard": "^16.0.2", | ||
"tap": "^14.10.8", | ||
"tsd": "^0.13.1", | ||
"tsd": "^0.14.0", | ||
"typescript": "^4.0.2" | ||
@@ -56,0 +57,0 @@ }, |
@@ -113,3 +113,3 @@ 'use strict' | ||
const route = '/public/' | ||
const content = { dirs: ['deep', 'shallow'], files: ['foo.html', 'foobar.html', 'index.css', 'index.html'] } | ||
const content = { dirs: ['deep', 'shallow'], files: ['.example', 'a .md', 'foo.html', 'foobar.html', 'index.css', 'index.html'] } | ||
@@ -164,2 +164,4 @@ helper.arrange(t, options, (url) => { | ||
<ul> | ||
<li><a href="/.example" target="_blank">.example</a></li> | ||
<li><a href="/a .md" target="_blank">a .md</a></li> | ||
<li><a href="/foo.html" target="_blank">foo.html</a></li> | ||
@@ -194,2 +196,4 @@ <li><a href="/foobar.html" target="_blank">foobar.html</a></li> | ||
<ul> | ||
<li><a href="/.example" target="_blank">.example</a></li> | ||
<li><a href="/a .md" target="_blank">a .md</a></li> | ||
<li><a href="/foo.html" target="_blank">foo.html</a></li> | ||
@@ -196,0 +200,0 @@ <li><a href="/foobar.html" target="_blank">foobar.html</a></li> |
@@ -9,3 +9,3 @@ import fastify from 'fastify' | ||
decorateReply: true, | ||
dotfiles: true, | ||
dotfiles: 'allow', | ||
etag: true, | ||
@@ -12,0 +12,0 @@ extensions: ['.js'], |
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
204282
29
2885