db/relays: normalize url before inserting

This commit is contained in:
Alex Gleason 2023-09-05 16:58:34 -05:00
parent 2ff40c8fc5
commit 5c02fd0773
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
1 changed files with 1 additions and 1 deletions

View File

@ -6,7 +6,7 @@ function addRelays(relays: `wss://${string}`[]) {
if (!relays.length) return Promise.resolve();
const values = relays.map((url) => ({
url,
url: new URL(url).toString(),
domain: tldts.getDomain(url)!,
active: true,
}));