@fastify/static
Advanced tools
Comparing version 7.0.3 to 7.0.4
@@ -224,3 +224,4 @@ 'use strict' | ||
const stream = send(request.raw, pathnameForSend, options) | ||
// `send(..., path, ...)` will URI-decode path so we pass an encoded path here | ||
const stream = send(request.raw, encodeURI(pathnameForSend), options) | ||
let resolvedFilename | ||
@@ -227,0 +228,0 @@ stream.on('file', function (file) { |
@@ -152,3 +152,3 @@ 'use strict' | ||
return { | ||
href: path.join(prefix, route, entry.name).replace(/\\/gu, '/'), | ||
href: encodeURI(path.join(prefix, route, entry.name).replace(/\\/gu, '/')), | ||
name: entry.name, | ||
@@ -155,0 +155,0 @@ stats: entry.stats, |
{ | ||
"name": "@fastify/static", | ||
"version": "7.0.3", | ||
"version": "7.0.4", | ||
"description": "Plugin for serving static files as fast as possible.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -157,3 +157,3 @@ 'use strict' | ||
const route = '/public/' | ||
const content = { dirs: ['deep', 'shallow'], files: ['.example', 'a .md', 'foo.html', 'foobar.html', 'index.css', 'index.html'] } | ||
const content = { dirs: ['deep', 'shallow'], files: ['.example', '100%.txt', 'a .md', 'foo.html', 'foobar.html', 'index.css', 'index.html'] } | ||
@@ -209,3 +209,4 @@ helper.arrange(t, options, (url) => { | ||
<li><a href="/public/.example" target="_blank">.example</a></li> | ||
<li><a href="/public/a .md" target="_blank">a .md</a></li> | ||
<li><a href="/public/100%25.txt" target="_blank">100%.txt</a></li> | ||
<li><a href="/public/a%20.md" target="_blank">a .md</a></li> | ||
<li><a href="/public/foo.html" target="_blank">foo.html</a></li> | ||
@@ -241,3 +242,4 @@ <li><a href="/public/foobar.html" target="_blank">foobar.html</a></li> | ||
<li><a href="/public/.example" target="_blank">.example</a></li> | ||
<li><a href="/public/a .md" target="_blank">a .md</a></li> | ||
<li><a href="/public/100%25.txt" target="_blank">100%.txt</a></li> | ||
<li><a href="/public/a%20.md" target="_blank">a .md</a></li> | ||
<li><a href="/public/foo.html" target="_blank">foo.html</a></li> | ||
@@ -498,3 +500,3 @@ <li><a href="/public/foobar.html" target="_blank">foobar.html</a></li> | ||
const route = '/public/' | ||
const jsonContent = { dirs: ['deep', 'shallow'], files: ['.example', 'a .md', 'foo.html', 'foobar.html', 'index.css', 'index.html'] } | ||
const jsonContent = { dirs: ['deep', 'shallow'], files: ['.example', '100%.txt', 'a .md', 'foo.html', 'foobar.html', 'index.css', 'index.html'] } | ||
@@ -546,3 +548,3 @@ helper.arrange(t, options, (url) => { | ||
const route = '/public/' | ||
const jsonContent = { dirs: ['deep', 'shallow'], files: ['.example', 'a .md', 'foo.html', 'foobar.html', 'index.css', 'index.html'] } | ||
const jsonContent = { dirs: ['deep', 'shallow'], files: ['.example', '100%.txt', 'a .md', 'foo.html', 'foobar.html', 'index.css', 'index.html'] } | ||
@@ -596,3 +598,3 @@ helper.arrange(t, options, (url) => { | ||
const route = '/public/' | ||
const jsonContent = { dirs: ['deep', 'shallow'], files: ['.example', 'a .md', 'foo.html', 'foobar.html', 'index.css', 'index.html'] } | ||
const jsonContent = { dirs: ['deep', 'shallow'], files: ['.example', '100%.txt', 'a .md', 'foo.html', 'foobar.html', 'index.css', 'index.html'] } | ||
@@ -599,0 +601,0 @@ helper.arrange(t, options, (url) => { |
Sorry, the diff of this file is too big to display
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
416122
70
5463
0