Przeglądaj źródła

add validation for uploading

kaoritokashiki 5 lat temu
rodzic
commit
39958ca74d
1 zmienionych plików z 8 dodań i 0 usunięć
  1. 8 0
      src/server/service/import.js

+ 8 - 0
src/server/service/import.js

@@ -476,6 +476,14 @@ class ImportService {
     // - import: throw err if there are pending migrations
   }
 
+  // 追加
+  validateVersionforUploading(meta) {
+    if (meta.version !== this.crowi.version) {
+      const versionErr = new Error('the version of this growi and the growi that exported the data are not met');
+      return versionErr;
+    }
+  }
+
   /**
    * Delete all uploaded files
    */