浏览代码

fix: override upload cache content-type

Nick 6 年之前
父节点
当前提交
d27ffe7ca4
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      server/models/assets.js

+ 1 - 0
server/models/assets.js

@@ -111,6 +111,7 @@ module.exports = class Asset extends Model {
     const cachePath = path.join(process.cwd(), `data/cache/${fileHash}.dat`)
 
     return new Promise((resolve, reject) => {
+      res.type(path.extname(assetPath))
       res.sendFile(cachePath, { dotfiles: 'deny' }, err => {
         if (err) {
           resolve(false)