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

Merge pull request #8239 from weseek/support/obsolete-route-for-attachment

support: Remove obsolete route for attachment on MongoDB GridFS
Yuki Takei 2 лет назад
Родитель
Сommit
c6cf1545c9
2 измененных файлов с 0 добавлено и 23 удалено
  1. 0 22
      apps/app/src/server/routes/attachment.js
  2. 0 1
      apps/app/src/server/routes/index.js

+ 0 - 22
apps/app/src/server/routes/attachment.js

@@ -310,28 +310,6 @@ module.exports = function(crowi, app) {
     return responseForAttachment(req, res, brandLogoAttachment);
   };
 
-  /**
-   * @api {get} /attachments.obsoletedGetForMongoDB get attachments from mongoDB
-   * @apiName get
-   * @apiGroup Attachment
-   *
-   * @apiParam {String} pageId, fileName
-   */
-  api.obsoletedGetForMongoDB = async function(req, res) {
-    if (crowi.configManager.getConfig('crowi', 'app:fileUploadType') !== 'mongodb') {
-      return res.status(400);
-    }
-
-    const pageId = req.params.pageId;
-    const fileName = req.params.fileName;
-    const filePath = `attachment/${pageId}/${fileName}`;
-
-    const attachment = await Attachment.findOne({ filePath });
-
-    return responseForAttachment(req, res, attachment);
-  };
-
-
   /**
    * @swagger
    *

+ 0 - 1
apps/app/src/server/routes/index.js

@@ -158,7 +158,6 @@ module.exports = function(crowi, app) {
   app.get('/me/*'                                 , loginRequiredStrictly, next.delegateToNext);
   app.get('/attachment/:id([0-9a-z]{24})'         , certifySharedPageAttachmentMiddleware , loginRequired, attachment.api.get);
   app.get('/attachment/profile/:id([0-9a-z]{24})' , loginRequired, attachment.api.get);
-  app.get('/attachment/:pageId/:fileName'       , loginRequired, attachment.api.obsoletedGetForMongoDB); // DEPRECATED: remains for backward compatibility for v3.3.x or below
   app.get('/download/:id([0-9a-z]{24})'         , certifySharedPageAttachmentMiddleware, loginRequired, attachment.api.download);
 
   app.get('/_search'                            , loginRequired, next.delegateToNext);