From 9d78c90a790002235d46cd64c21cfac3caf9a44b Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Mon, 12 Feb 2024 15:32:50 -0300 Subject: [PATCH] nip46: fix bunker url parsing. --- nip46.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/nip46.ts b/nip46.ts index d473aa1..1c3caa4 100644 --- a/nip46.ts +++ b/nip46.ts @@ -16,7 +16,7 @@ export function useFetchImplementation(fetchImplementation: any) { _fetch = fetchImplementation } -export const BUNKER_REGEX = /^bunker:\/\/[0-9a-f]{64}\??[?\/\w:.=&%]*$/ +export const BUNKER_REGEX = /^bunker:\/\/([0-9a-f]{64})\??([?\/\w:.=&%]*)$/ const EMAIL_REGEX = /^[^\s@]+@[^\s@]+\.[^\s@]+$/ export type BunkerPointer = { @@ -31,11 +31,12 @@ export async function parseBunkerInput(input: string): Promise