Yuki Takei 7 лет назад
Родитель
Сommit
879a5003f1
1 измененных файлов с 14 добавлено и 0 удалено
  1. 14 0
      src/server/routes/attachment.js

+ 14 - 0
src/server/routes/attachment.js

@@ -13,6 +13,13 @@ module.exports = function(crowi, app) {
   const fileUploader = require('../service/file-uploader')(crowi, app);
 
 
+  /**
+   * Common method to response
+   *
+   * @param {Response} res
+   * @param {Attachment} attachment
+   * @param {boolean} forceDownload
+   */
   async function responseForAttachment(res, attachment, forceDownload) {
     let fileStream;
     try {
@@ -27,6 +34,13 @@ module.exports = function(crowi, app) {
     return fileStream.pipe(res);
   }
 
+  /**
+   * set http response header
+   *
+   * @param {Response} res
+   * @param {Attachment} attachment
+   * @param {boolean} forceDownload
+   */
   function setHeaderToRes(res, attachment, forceDownload) {
     // download
     if (forceDownload) {