Remove newlines before checking equality

This commit is contained in:
Yarmo Mackenbach 2020-09-10 23:43:51 +02:00
parent 6c964bf052
commit 28742ede99

View file

@ -106,7 +106,7 @@ const VerifyJsonProof = (data, checkPath, checkClaim, checkRelation) => {
return re.test(data); return re.test(data);
break; break;
case 'eq': case 'eq':
return data.toLowerCase() == checkClaim.toLowerCase(); return data.replace(/\r?\n|\r/, '').toLowerCase() == checkClaim.toLowerCase();
break; break;
case 'oneOf': case 'oneOf':
re = new RegExp(checkClaim, "gi"); re = new RegExp(checkClaim, "gi");