diff --git a/lib/files.js b/lib/files.js index 0542a6c..0aa5e99 100644 --- a/lib/files.js +++ b/lib/files.js @@ -25,11 +25,11 @@ module.exports = (base, default_price, invoice_ttl, files_attr) => { if (/^\.\.\//.test(relpath) || reIgnore.test(name)) throw new Error('forbidden') - const file = { fullpath, path: relpath, urlpath: escape(relpath), name, ext, dirname, attr } + const file = { fullpath, path: relpath, urlpath: escape(relpath), name, ext, dirname } , stat = await fs.stat(fullpath) return stat.isDirectory() ? { ...file, type: 'dir', files: !shallow && await listFiles(fullpath) } - : stat.isFile() ? { ...file, type: 'file', size: stat.size, price: attr.price || default_price + : stat.isFile() ? { ...file, type: 'file', size: stat.size, attr, price: attr.price || default_price , mime: await getMime(file), exif: !shallow && await getExif(fullpath) } : null }