Просмотр исходного кода

Merge pull request #2636 from weseek/fix/uploaded-image-is-not-displayed

fix/uploaded-image-is-not-displayed
Yuki Takei 5 лет назад
Родитель
Сommit
0d17b2e5f1
1 измененных файлов с 3 добавлено и 3 удалено
  1. 3 3
      src/server/middlewares/certify-shared-file.js

+ 3 - 3
src/server/middlewares/certify-shared-file.js

@@ -10,7 +10,7 @@ module.exports = (crowi) => {
     const { path } = url.parse(referer);
 
     if (!path.startsWith('/share/')) {
-      next();
+      return next();
     }
 
     const fileId = req.params.id || null;
@@ -21,14 +21,14 @@ module.exports = (crowi) => {
     const attachment = await Attachment.findOne({ _id: fileId });
 
     if (attachment == null) {
-      next();
+      return next();
     }
 
     const shareLinks = await ShareLink.find({ relatedPage: attachment.page });
 
     // If sharelinks don't exist, skip it
     if (shareLinks.length === 0) {
-      next();
+      return next();
     }
 
     // Is there a valid share link