From 32bcff86f5595e96520fca010f6092957aed13c6 Mon Sep 17 00:00:00 2001 From: "moxey.eth" Date: Mon, 19 Feb 2024 13:57:29 +1100 Subject: [PATCH] fix: verify url --- src/utils/verifyFrame.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/utils/verifyFrame.ts b/src/utils/verifyFrame.ts index d226fd1b..39df12ed 100644 --- a/src/utils/verifyFrame.ts +++ b/src/utils/verifyFrame.ts @@ -1,5 +1,6 @@ import { hexToBytes } from '@noble/curves/abstract/utils' import { type TrustedData } from '../types.js' +import { parsePath } from './parsePath.js' export type VerifyFrameParameters = { fetchOptions?: RequestInit @@ -29,6 +30,6 @@ export async function verifyFrame({ if (!response.valid) throw new Error(`message is invalid. ${response.details}`) - if (!frameUrl?.startsWith(url)) + if (!parsePath(frameUrl)?.startsWith(parsePath(url))) throw new Error(`Invalid frame url: ${frameUrl}. Expected: ${url}.`) }