From 017570f560d9a053c16a368a14dbec93b23f4fb2 Mon Sep 17 00:00:00 2001 From: Hank Stoever Date: Thu, 26 Oct 2023 06:14:01 -0700 Subject: [PATCH] fix: newlines comparison in inscription --- web/pages/api/bridge-sig.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/web/pages/api/bridge-sig.ts b/web/pages/api/bridge-sig.ts index abd8e02..4d0f060 100644 --- a/web/pages/api/bridge-sig.ts +++ b/web/pages/api/bridge-sig.ts @@ -9,6 +9,7 @@ import { signatureVrsToRsv } from '@common/utils'; import { createWrapperV2Signature } from '@pages/api/wrapper-sig-v2'; import { inscriptionContentForName } from '@bns-x/bridge'; import { err, ok } from 'neverthrow'; +import { inspect } from 'util'; export type BridgeSignerResponseOk = { signature: string; @@ -52,7 +53,8 @@ export async function bridgeSignerApi( if (contentResult.isErr()) { return res.status(500).send({ error: contentResult.error }); } - if (contentResult.value !== inscriptionContentForName(fqn)) { + const content = contentResult.value.trim().replaceAll('\r\n', '\n'); + if (content !== inscriptionContentForName(fqn)) { return res.status(400).send({ error: 'Invalid inscription' }); }