Aktueller Stand
This commit is contained in:
8
backend/node_modules/@fastify/static/lib/dirList.js
generated
vendored
8
backend/node_modules/@fastify/static/lib/dirList.js
generated
vendored
@@ -108,7 +108,7 @@ const dirList = {
|
||||
*/
|
||||
send: async function ({ reply, dir, options, route, prefix, dotfiles }) {
|
||||
if (reply.request.query.format === 'html' && typeof options.render !== 'function') {
|
||||
throw new Error('The `list.render` option must be a function and is required with the URL parameter `format=html`')
|
||||
throw new TypeError('The `list.render` option must be a function and is required with the URL parameter `format=html`')
|
||||
}
|
||||
|
||||
let entries
|
||||
@@ -125,9 +125,9 @@ const dirList = {
|
||||
entries.dirs.forEach(entry => nameEntries.dirs.push(entry.name))
|
||||
entries.files.forEach(entry => nameEntries.files.push(entry.name))
|
||||
|
||||
reply.send(nameEntries)
|
||||
await reply.send(nameEntries)
|
||||
} else {
|
||||
reply.send(entries)
|
||||
await reply.send(entries)
|
||||
}
|
||||
return
|
||||
}
|
||||
@@ -135,7 +135,7 @@ const dirList = {
|
||||
const html = options.render(
|
||||
entries.dirs.map(entry => dirList.htmlInfo(entry, route, prefix, options)),
|
||||
entries.files.map(entry => dirList.htmlInfo(entry, route, prefix, options)))
|
||||
reply.type('text/html').send(html)
|
||||
await reply.type('text/html').send(html)
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user