forked from Mirrors/doipjs
When performing plaintext proof comparison, remove spaces before
searching for fingerprint Fixes #22
This commit is contained in:
parent
542bab3232
commit
0e543946db
1 changed files with 7 additions and 1 deletions
|
@ -55,8 +55,14 @@ const containsProof = async (data, params) => {
|
||||||
data = entities.decodeHTML(data)
|
data = entities.decodeHTML(data)
|
||||||
|
|
||||||
// Check for plaintext proof
|
// 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()
|
.toLowerCase()
|
||||||
|
// search for fingerprint
|
||||||
.indexOf(fingerprintFormatted.toLowerCase()) !== -1
|
.indexOf(fingerprintFormatted.toLowerCase()) !== -1
|
||||||
|
|
||||||
// Check for hashed proof
|
// Check for hashed proof
|
||||||
|
|
Loading…
Reference in a new issue