Improve relay scoring

This commit is contained in:
Jon Staab
2025-01-15 09:54:19 -08:00
parent b195124da4
commit 29a0726165
3 changed files with 27 additions and 14 deletions
+7 -6
View File
@@ -35,13 +35,14 @@ export const isRelayUrl = (url: string) => {
url = "wss://" + url
}
if (!url.match(/^wss?:\/\//)) {
return false
}
// Skip non-ws urls
if (!url.match(/^wss?:\/\//)) return false
if (!url.match(/\./)) {
return false
}
// Skip urls with a slash before the dot
if (url.match(/\\.*\./)) return false
// Skip urls without a dot
if (!url.match(/\./)) return false
try {
new URL(url)