enhance parseConnectionString to support double slash URL format

This commit is contained in:
SondreB
2025-07-12 11:35:00 +02:00
committed by fiatjaf_
parent f0357805c3
commit 2f529b3f8a
2 changed files with 12 additions and 2 deletions

View File

@@ -9,8 +9,8 @@ interface NWCConnection {
}
export function parseConnectionString(connectionString: string): NWCConnection {
const { pathname, searchParams } = new URL(connectionString)
const pubkey = pathname
const { host, pathname, searchParams } = new URL(connectionString)
const pubkey = pathname || host
const relay = searchParams.get('relay')
const secret = searchParams.get('secret')