Trim the decoded QR code contents before we try to parse them as JSON

* Nunavut QR code has a zero-width space in front of the JSON which was
  blowing up parsing - this fixes it
This commit is contained in:
Ryan Slobojan 2021-10-25 17:40:31 -04:00
parent 4d99135449
commit 30877d1a89
1 changed files with 1 additions and 1 deletions

View File

@ -60,7 +60,7 @@ function decodeJWSPayload(decodedPayload) {
try {
//console.log(decompressedResult);
scannedResult = decompressedResult.toString("utf8");
resolve(JSON.parse(scannedResult));
resolve(JSON.parse(scannedResult.trim()));
} catch (e) {
reject(e);
}