feat: default to wss:// when URL has no protocol

This commit is contained in:
codytseng
2025-01-04 23:30:54 +08:00
parent 14eee0240b
commit be7081359d

View File

@@ -47,6 +47,7 @@ export function RelaySettingsProvider({ children }: { children: React.ReactNode
const searchParams = new URLSearchParams(window.location.search)
const tempRelays = searchParams
.getAll('r')
.map((url) => (url.startsWith('wss://') || url.startsWith('ws://') ? url : `wss://${url}`))
.filter((url) => isWebsocketUrl(url))
.map((url) => normalizeUrl(url))
if (tempRelays.length) {