Преглед на файлове

Merge pull request #3395 from daniel-eder/fix/clone-board-binary-attachments

Treat unknown attachment types as binary on board import/clone
Lauri Ojansivu преди 4 години
родител
ревизия
86c7fbd717
променени са 1 файла, в които са добавени 6 реда и са изтрити 0 реда
  1. 6 0
      models/wekanCreator.js

+ 6 - 0
models/wekanCreator.js

@@ -474,6 +474,12 @@ export class WekanCreator {
                 }
                 }
               });
               });
             } else if (att.file) {
             } else if (att.file) {
+              //If attribute type is null or empty string is set, assume binary stream
+              att.type =
+                !att.type || att.type.trim().length === 0
+                  ? 'application/octet-stream'
+                  : att.type;
+
               file.attachData(
               file.attachData(
                 Buffer.from(att.file, 'base64'),
                 Buffer.from(att.file, 'base64'),
                 {
                 {