Do content checks on the drive so if it gets corrupted, the patch will be rejected

pull/1/head
Caleb James DeLisle 2017-11-11 01:26:54 +01:00
parent ac66511f0a
commit eaa7b6e8e5
1 changed files with 9 additions and 0 deletions

View File

@ -297,6 +297,15 @@ define([
crypto: Crypto.createEncryptor(secret.keys),
userName: 'fs',
logLevel: 1,
validateContent: function (content) {
try {
JSON.parse(content);
return true;
} catch (e) {
console.error("Failed to parse, rejecting patch");
return false;
}
},
};
var exp = {};