When performing plaintext proof comparison, remove spaces before

searching for fingerprint

Fixes #22
This commit is contained in:
Preston Maness 2023-06-14 03:11:20 -05:00
parent 542bab3232
commit 0e543946db

View file

@ -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