Skip to content

Commit

Permalink
fix: newlines comparison in inscription
Browse files Browse the repository at this point in the history
  • Loading branch information
hstove committed Oct 26, 2023
1 parent d347241 commit 017570f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion web/pages/api/bridge-sig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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' });
}

Expand Down

0 comments on commit 017570f

Please sign in to comment.