From 0e543946db748a2e3556c6a57184de7bff788978 Mon Sep 17 00:00:00 2001 From: Preston Maness Date: Wed, 14 Jun 2023 03:11:20 -0500 Subject: [PATCH] When performing plaintext proof comparison, remove spaces before searching for fingerprint Fixes #22 --- src/verifications.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/verifications.js b/src/verifications.js index dc1050e..451578f 100644 --- a/src/verifications.js +++ b/src/verifications.js @@ -55,8 +55,14 @@ const containsProof = async (data, params) => { data = entities.decodeHTML(data) // Check for plaintext proof - result = data.replace(/\r?\n|\r/g, '') + result = data + // remove newlines and carriage returns + .replace(/\r?\n|\r/g, '') + // remove spaces + .replace(/\s/g, '') + // normalize .toLowerCase() + // search for fingerprint .indexOf(fingerprintFormatted.toLowerCase()) !== -1 // Check for hashed proof