Display search property alongside host in relay name (#452)

This commit is contained in:
heyhoe
2023-03-23 22:25:07 +09:00
committed by GitHub
parent d5f828ffb8
commit e95f1fe369
4 changed files with 30 additions and 5 deletions

View File

@ -462,3 +462,8 @@ export async function hmacSha256(key: Uint8Array, ...messages: Uint8Array[]) {
return hmac(hash, key, secp.utils.concatBytes(...messages));
}
}
export function getRelayName(url: string) {
const parsedUrl = new URL(url);
return parsedUrl.host + parsedUrl.search;
}