Normalize tor urls to use ws://

This commit is contained in:
Jon Staab
2025-01-14 15:58:04 -08:00
parent e72d49e563
commit 72e2787ec2
4 changed files with 12 additions and 5 deletions
+1 -1
View File
@@ -62,7 +62,7 @@ export const isIPAddress = (url: string) => Boolean(url.match(/\d+\.\d+\.\d+\.\d
export const isShareableRelayUrl = (url: string) => Boolean(isRelayUrl(url) && !isLocalUrl(url))
export const normalizeRelayUrl = (url: string) => {
const prefix = url.match(/^wss?:\/\//)?.[0] || "wss://"
const prefix = url.match(/^wss?:\/\//)?.[0] || (isOnionUrl(url) ? "ws://" : "wss://")
// Use our library to normalize
url = normalizeUrl(url, {stripHash: true, stripAuthentication: false})